Approval Notification Target

Ankur Swami
Tera Guru

Hi Experts,

 

I got stuck in a weird issue, Not sure how can i resolve this or what i did wrong. Please help me with the query mentioned below.

 

i have one event registry record:

Name:  x_test_approval_event

Table: sysapproval_approver

 

I have one notification:

Name: Test Notification

Table: sysapproval_approver

Trigger Condition : Event is fired "x_test_approval_event"

 

Event is getting Triggered from Workflow: 

Workflow Activity Name : Approver User

code:  gs.eventQueue('x_test_approval_event', current, parm 1 value, parm 2 value); 

Note: Workflow is on a custom table. 

 

Question is: When the notification is getting triggered, Then in the email logs the target record is getting set as the actual record(custom task table)  not the approval record from the 'sysapproval_approver' table.

 

Can anyone suggest why this is happening. Ideally the approval record should be set in the target.

 

I hope i tried my best to give an overview of my query. Please help me on this or suggest me what i did wrong.

 

Thanks,

Ankur 

 

1 ACCEPTED SOLUTION

Sebastian L
Mega Sage

Hi, since you are in the workflow, so when you use current, the current object will be on where the workflow runs. 

 

So you will need to change current to the object of the approval record instead. Since it is a workflow, you might need to lookup the approval record.  

code:  gs.eventQueue('x_test_approval_event', current, parm 1 value, parm 2 value); 


Best regards,
Sebastian Laursen

View solution in original post

2 REPLIES 2

Sebastian L
Mega Sage

Hi, since you are in the workflow, so when you use current, the current object will be on where the workflow runs. 

 

So you will need to change current to the object of the approval record instead. Since it is a workflow, you might need to lookup the approval record.  

code:  gs.eventQueue('x_test_approval_event', current, parm 1 value, parm 2 value); 


Best regards,
Sebastian Laursen

Aman Kumar S
Kilo Patron

The rule for event dictates

The event, the notification and the parameter that you are passing on in the queueEvent function should be of same table.

And also if your event is in custom application, you need to add application scope in queue event name as well.

 

Suppose your event is "x_test_approval_event" and your scope is "x_nuvo_custom"

In event queue you need to pass "x_nuvo_custom.x_test_approval_event".

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar