Permissions and access on a forms UI actions

Dev321
Tera Contributor

I have a form that has several different activity statuses that are triggered via UI actions (approval,activate,pause,cancel complete)

I need to limit the access to this user for only when the form is in draft or new and only for the UI action submit for approval. 

How do i limit the remaining UI action access to the form. would this be via a client script or UI policy?

2 REPLIES 2

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

I believe it has to be combination of UI policy and client script -

Create a new UI policy

  • Table: [Specify your table name]
  • Advanced: [Specify the condition for activity status being "Draft" or "New"]
  • Action: Read

Client script can be something like this -

 

function onSubmit() {
  var activityStatus = g_form.getValue('activity_status');
  if (activityStatus !== 'draft' && activityStatus !== 'new') {
    // Disable UI actions other than "Submit for Approval"
    g_form.disableUIAction('activate');
    g_form.disableUIAction('pause');
    g_form.disableUIAction('cancel');
    g_form.disableUIAction('complete');
  }
}

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar

Dev321
Tera Contributor

Hi in this script shouldn't i specify that this role if for the lead or approver so it can be specific to their role. I'm not sure the conditions allow me to show if the user is a lead.

 

i'll need to make these permission based on UI for a lead user, a approver and a standard activity user