Question

Application defined event - STEP_REJECTED_NODOC


Userlevel 1
Badge +5

Hi, 

I am trying to set up an event to notify customer order’s salesman about rejected approval process. We have set up approval process on customer order line. When one step is approved, the next step’s approver corretly gets an email about next step approval information.

But when one approver reject the step, noone gets email.

I tried to set up app. defined event STEP_REJECTED_NODOC (i didn’t use APPROVAL_ROUTE_REJECTED event, becuase it is supposed to be dedicated to Documents only). 

When I put my username in section “Mail to” (let’s say IFSUSR user) i correctly receive email with reject info. But i need to send the info of “rejecting” to salesman of customer order. 

I tried to put to “Mail to” this API: customer_order_api.get_salesman_code(&KEY03) that gives me back username of CO’s salesman, but in the “Application messages” i see error “Mail address ‘To’ field is not specified”. 

When i run the API in sql developer i correctly get salesman code.

Is ti possible to use API in “Mail to” parameter??

 

Thanks

Jan West

 

 


5 replies

Userlevel 5
Badge +13

HI @westjan,

In the respective event, you can define a custom attribute in the below section.


You can write the API call there and get the relevant info to a parameter. In the Email action, you can straight away use this parameter.


Hope this helps!
Best Regards,
Bhagya

Userlevel 1
Badge +5

Hi,

thanks for your answer, but this is impossible, becuase i cannot “Show details” on application defined event. I am using this on custome defined. Or am I missing someting??

 

 

 

Thanks

jan west

Userlevel 5
Badge +13

Hi @westjan,

Alright, I understood your question. For an application defined event you cannot follow the above approcah. Hence you cannot add the parameter directly to the event but you can try this.

1. Create a new action to the application defined event. Which is of type SQL and fetch the required data.
2. Create a new event that will send an email and call the original application defined event (above event) and forward the required parameters.

Hope this helps!

Best Regards,
Bhagya

Userlevel 1
Badge +5

Hi, 

i see but i would like to use first approach but i don’t know how to call the event in “Online SQL” event. I can imagine to put the “customer_order_api.get_salesman_code(&KEY03)” to a parameter but then how to call the event and send it to the parameter?

 

Userlevel 6
Badge +15

@westjan not sure if you already found a solution for this, but I believe the best way would be to create your own custom event on the Approvals table. There you could create custom attributes to get the CO No from ObjKey and also get the Salesman from CO.

Reply