Issue Resolved: Validate Field Restricting Other Body/Line Level Fields

When validating certain body-level fields in the client script file, it may accidentally restrict access to other body or line-level fields. Below is the proposed solution to address this issue.

function validateField(scriptContext) {

      let record = scriptContext.currentRecord;

      let field = scriptContext.fieldId;

      if (field === ‘memo’) {

        let memoField = record.getValue(‘memo’);

        if (memoField == ‘UX’) {

          message.create({

            type: message.Type.CONFIRMATION, title: ‘Memo Field Updated’, message: “Memo field had been updated: “ + memoField, duration: 8000

          }).show();

          return true

        } else {

          message.create({

            type: message.Type.WARNING, title: “Memo field warning”, message: “Memo field value is not as expected: “+ memoField, duration: 8000 

          }).show();

          return false

        }

      }

return true => This return true in the validate field entry point allow all other fields to be processed normally.

    }

Leave a comment

Your email address will not be published. Required fields are marked *