I am a novice :) Can't figure out why I am getting this "Could not save record because of a compile error: JavaScript parse error at line (32) column (33) problem = missing ( before condition" error. It then leads to ; missing when I do find a spot


#1

This isn't the entire code, however, it's the portion that's causing the fits:

if (tableName == 'sc_task')
parentRecord.addQuery("sys_id", current.table_sys_id);
parentRecord.query();
if (parentRecord.next())
var confidentialFlag = parentRecord.getElement('confidentialFlagFieldName')
if confidentialFlag = checked
Call onLoad function (this function should return True or False based on the User Roles)

return parentRecord.canRead();


#2

You need parenthesis around your conditions, curly braces around your code blocks, and double equals signs in your conditions:

if (tableName == 'sc_task'){
   parentRecord.addQuery("sys_id", current.table_sys_id); 
   parentRecord.query();
   if (parentRecord.next()){
      var confidentialFlag = parentRecord.getElement('confidentialFlagFieldName')
      if (confidentialFlag == checked){
         //Call onLoad function (this function should return True or False based on the User Roles)
        return parentRecord.canRead();
      }
   }
}

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.