The CreatorCon Call for Content is officially open! Get started here.

Delegate roles to users

suresh40
Tera Contributor

Hi All,

 

I created a catalog item called "Delegate Roles". A variable like delegate table fields is created on that catalog item. A workflow is created and mapped to a catalog item. In that workflow I gave approval to my client's manager, if she approves the records should be created in the delegate table. After the Approves step created a run script and map to the delegate table to that workflow. Run script is working fine.

 

Here my issue is while approving from Admin account (My Account )record is creating in delegate table, But my manager approving (she has user_admin role)the request record is not creating in the delegate table. 

 

Run Script is :

var gr = new GlideRecord('sys_user_delegate');
gr.initialize();
gr.user = current.variables.user;
gr.delegate = current.variables.delegate;
gr.starts = current.variables.starts;
gr.ends = current.variables.ends;
gr.approvals = current.variables.approvals;
gr.notifications = current.variables.notifications;
gr.insert();
 
suresh40_0-1710834121623.png

 

 

Thanks, 

Suresh

 

1 ACCEPTED SOLUTION

Vedang1
Tera Expert

Hi @suresh40 ,

 

In most cases, this happens because the last action before automation was performed by someone who does not have the required access.

 

A simple solution is to add a timer action in the workflow right before your script action.

It can be a simple 3 second timer.

 

This ensures that all actions after it are performed via the system, which would have the required access.

Hope this helps!

Please mark it as solution proposed and helpful if its serves your purpose.

Thank you,
Vedang

View solution in original post

2 REPLIES 2

Mark Manders
Mega Patron

Check the ACL's, because it could very well be that you can only create a delegate record for yourself (unless you are the admin). 

Maybe use a flow instead of a workflow and set it to run as administrator. It bypasses this issues.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Vedang1
Tera Expert

Hi @suresh40 ,

 

In most cases, this happens because the last action before automation was performed by someone who does not have the required access.

 

A simple solution is to add a timer action in the workflow right before your script action.

It can be a simple 3 second timer.

 

This ensures that all actions after it are performed via the system, which would have the required access.

Hope this helps!

Please mark it as solution proposed and helpful if its serves your purpose.

Thank you,
Vedang