Sunday, December 23, 2018

Unmark Internal Only checkbox on Support Case Record depending on user's role via SuiteScript

For Support Case records, Administrators have the capability to set Support Case as Internal Only. This can be set at Setup > Support > Support Preferences > Under the General tab, Default Case Form to Internal Only = True. Thus, when users create a new Support Case record, by default, the Internal Only checkbox is always marked. However, there are scenarios wherein such setup is not applicable. This sample code demonstrates how the Internal Only checkbox will be unmarked depending on the user's role. This must be applied on a Client Script on Page Init function.

function uncheckInternalOnly()
   var role = nlapiGetRole();
   var supportRoleId = <replace with support role internal id>;
   if(role == supportRoleId)
      nlapiSetFieldValue('internalonly', 'F');

No comments:

Post a Comment