You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Task Object – Conditional Field Updateability (On Edit Script not working dynamically)

in Sales 1 comment

At Mobile Application Setup (at CX Sales Mobile Scripts), I am trying to make the custom field Reject Division (PRTFixChoiceListField_02_c) editable only when the vanilla field Outcome has the value 'REJECTION'.

I have added the following script under On Edit (Server Script) for the Task object:

const taskRow = getCurrentRow();
const outcome = taskRow.OutcomeCode;
taskRow.setColumnUpdatable('PRTFixChoiceListField_02_c', outcome === 'REJECTION');

However, the field always remains read-only, in both cases.
It seems that the process is not happening on the fly (when the Outcome is changed in the Μobile UI). The Reject Division field does not dynamically switch between editable and read-only in that moment.

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!