Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
13,783
From the release 1911 of SAP Cloud for Customer, you'll notice new and exciting features while configuring the recipients in the workflow rules of type e-mail in SAP Cloud for Customer. In this blog post, I want to share the features existing till the release 1908, what has been added in 1911 and how it will help you out in configuring the recipients in a more flexible manner.

The ability to automate a process of sending out an e-mail, sms, notification, WhatsApp text, updating field(s) or triggering an action on a create/update of a document through workflow rules has been a key component of SAP Cloud for Customer. Until the release 1908 of SAP Cloud for Customer, an e-mail could only be sent out to the recipients who were the business partners in the system. A recipient could be an account, contact, individual customer or an employee. Workflow Rule didn't support sending out an e-mail directly to an e-mail address which was not associated with any business partner in the system.

Earlier, you could configure recipients in the workflow rule only in the following two ways:

  1. Recipient determination: This includes a set of standard recipient determinations depending on the Business Object for which the workflow rule is configured. It also includes z-parties defined by the customer in the business configuration.

  2. Employee: This option is used to directly configure all those employees who should be receiving the e-mail whenever the workflow rule is triggered.


The above-mentioned ways of configuring the recipients could meet most of the customer's use cases, but did not meet the following scenarios:

  1. Ability to send out e-mail directly to an e-mail address

  2. Ability to create your own custom recipient determination to meet the use cases which are not covered by the standard recipient determinations


From the 1911 release, you will see the following new features which have been added to Workflow rules of type e-mail that will help you to achieve the above-mentioned scenarios:

  1. E-Mail Address: With this feature, you will be able to configure in workflow rule, the e-mail addresses to which the e-mail can be sent out directly

  2. Custom Recipient Determination: With this feature, you will be able to do your own PDI enhancement implementation. In that implementation, you can write your own logic to return a table of business partner UUIDs that are existing in the system, and/or to return a table of e-mail addresses. If you configure this custom recipient determination in the workflow rule, then the workflow rule will call the determination during its execution and will send the e-mail to the business partners and/or to the e-mail addresses returned by your custom implementation.


You can follow the following steps to implement the Custom Recipient Determination:

  1. Login into your cloud application studio.

  2. Right click on your PDI solution and click on Add-> New Item.

  3. Select Extension from left hand side tree and select Enhancement Implementation. You have to provide some meaningful enhancement implementation name in the Name field and click on Add. Please note that the same name will appear under Custom Recipient Determination when you configure the workflow rule.

  4. Select Namespace and Enhancement Option as shown below and click on OK.

  5. Select .fltr file which got created from the Solution Explorer and provide the MO name for which this custom recipient determination will trigger.

  6. Double click on DETERMINE_CUST_RECIP.absl file. You can write your custom logic to determine the recipients depending on your business use case in this file. The output of the code can be stored in result variable which can have both business partner UUID’s and/or the recipient email ids to whom the e-mail will be sent out. You need to activate all the files and the solution once your code changes are done.

  7. Now when you will configure the workflow rule, you will see the custom recipient determination that was created under Custom Recipient Determination table.


 

Once you have activated the rule, at the time of its execution, it will call the custom recipient determinations configured in it along with the other Recipient Determinations, Employees and E-Mail addresses configured to send out an email to all the determined recipients.

As you can see, with these new features, the possibility to determine Recipients in workflow rules of type e-mail is extremely flexible and helpful.

 
30 Comments
Thanks Ankur for writing this Blog.

C4C tenant is upgraded to 1911 and we followed the above provided steps to build our custom recipient determination logic. We ensured that,we are using correct BADI -"ExitForGettingWorkflowRecipient" and also solution is activated.

When we try to configure the work flow rule of type e-mail for Ticket, we don't see our enhancement implementation name in the drop-down under "Custom Recipient Determination".

Do we need to enable/activate anything else? Can you please provide your some insight?

Thanks in advance for your help.

 

Thanks,

Akhil
neehcs
Explorer
0 Kudos
Hi Ankur,

Great stuff! Is the ability to set the FROM e-mail address as recipient for a workflow also on the roadmap? So that the notification is always sent as reply to the sender, even if it's an unknown contact.

If so, do you know for which release?

Kind regards,
Jasper
0 Kudos
Hello Akhilendra,

Did you provide the filter as "Ticket" as mentioned in the step 5?

Best Regards,

Ankur
0 Kudos
Hello Jasper,

Could you please check if your tenant is upgraded to 1911? If so, if you try configuring a workflow rule on "E-mail" object then under "Custom Recipient Determination" you should see an option of "Message From". This would enable you to reply to unknown contacts as well.

Best Regards,

Ankur
0 Kudos
Hello Akhilendra,

Have you grouped together your enhancement files in a folder? That might be an issue at the moment. For now, can you try moving the files out of the folder and try again?

Regards,

Ankur
chackoanil
Explorer
0 Kudos
Hi Ankur,

I tried to implement as the steps provided in this blog. As you have mentioned here, I have given 'Ticket' in filter and also added the enhancement outside folder. I am still not able to view the enhancement name listed in custom recipient determination.

Do you know of anything else which could cause this issue?

Thanks

Anil
0 Kudos
Hello Anil,

'Ticket' as a filter has to be given only if you are creating a workflow rule on "Ticket" object. For other objects, the filter has to be different. Did you use the same object? If yes, could you share the incident details?

Regards,

Ankur
debsharma007
Discoverer
0 Kudos

Hi Ankur

I’ve done same as mentioned in your blog and the BO is also ticket BO but still it’s not showing in the custom recipient determination section.

And besides that if you can provide one same logic for the recipient determination then it’ll be a great help.

 

Thanks

Debasish

0 Kudos

Hello Debasish,

There was a bug, a fix which should have been deployed this weekend. You can check again on Monday. If issue still persists, then let us know.

 

Code snippet:

Your logic should determine the appropriate agent uuid and/or email address.

Regards,

Ankur

chackoanil
Explorer
0 Kudos
Hi Ankur,

 

Yes, I was trying to use it for a ticket workflow.

Right now it is working  for me.

 

We also would like to use the same implementation for sales quote workflow.

Could you please let me know what is the meta object name for Sales quote?

Thank you in advance.

-Anil
0 Kudos
Hi Anil,

Here's the list:











































































































































Business Object Meta Object (Filter)
Content Transfer /EXT/KUSL_CONTENT_TRANSFER
Activity Task ACTIVITY_TASK
Visit APPOINTMENT_ACTIVITY
Assignment ASSIGNMENT_ACTIVITY
Partner Registration CHNL_PARTNER_REG
Appointment COD_APPOINTMENT
Campaign COD_CAMPAIGN
Contact COD_CONTACT
Account COD_CUSTOMER
Individual Customer COD_IND_CUSTOMER
Phone Call COD_PHONECALL
Sales Data COD_SALES_ARRANGEMENT
Time Report COD_TIMEREPORT_NOTIFICATION
Contract CONTRACT
Sales Order CUSTOMER_ORDER
Sales Quote CUSTOMER_QUOTE
Deal Registration DEAL_REG
E-Mail EMAIL_ACTIVITY
Incident INCIDENT
Installation Point/Registered Product INSTALLATION_POINT
Installed Base INSTALLED_BASE
Insurance Policy INSURANCE_POLICY
Insurance Quick Quote INSURANCE_QUICK_QUOTE
Insurance Quote INSURANCE_QUOTE
Currency Exchange Rate LEAP_CER_EXCHANGE_RATE
Leads MARKETING_LEAD
Opportunity OPPORTUNITY
Project Alert PROJECT_ALERT
Promotion PROMOTION
Sales Lead SALES_LEAD
Social Media Message Import Run SOC_MED_ACT_CREATION_RUN
Ticket TICKET
Transport Request UNIFIED_TRANSPORT_REQUEST

 

Best Regards,

Ankur

 

 
former_member645101
Discoverer
0 Kudos
Hi Ankur,

I have a custom BO "Project" where we create project IDs and maintain Escalation matrix with a list of employees.

Extended the Ticket creation screen with a new OVS field "Project" to select the project ID from the custom BO. Ticket has been created with a project added.

Now, the requirement is to send email to the employees maintained in escalation matrix of Project BO based on some conditions in Ticket. Is it possible to get the Project BO data from this enhancement option as I could see only the below two values in inputdata. If possible, please guide me how this can be done else what would be the alternative.

 



 

Regards,

Kishore.
0 Kudos
Hello Kishore,

I believe you are trying to create a workflow on Ticket in order to use the conditions on the same. Here TriggerBOUUID should be the uuid of Ticket, Hence in the enhancement implementation you can use this ticket uuid to navigate to your project BO instance and fetch the relevant information and return the recipients accordingly.

Regards,

Ankur
former_member518977
Discoverer
0 Kudos
Hi Ankur,

First of all , Thanks for your blog on this topic. I recently I implemented this enhancement for object Activity Task  . I followed the same steps with Filter - ACTIVITY_TASK' but the enahncement is not available when I try to define work flow Rule for BO:ActivityTask . I Re-do the same steps for 3 times but no luck. Even I created the incident to SAP, they simply rejected without mentioning the reason.

I Created the enhancement inside the folder. Still have bug in SAP Solution. Please confirm the same. I appreciative if you could provide more on this.

 

Thanks

Srinivas
0 Kudos
Hi Srinivas,

You should raise an incident for this. Not sure why was it rejected as you mentioned. Ideally it should have worked.

Regards,

Ankur
0 Kudos

Hi ankur.gupta04

Can we implement the same configuration for sending SMS, our requirement is to send the SMS on number which is captured on the Custom field of Service Ticket. Can we use this Enhancement implementation to send SMS without creating customer/Party involved in the system.

 

Thanks and Regards

Nimisha Ray

0 Kudos
Hello Nimisha,

No, at the moment it is supported only for e-mail. You can raise an idea on the idea forum to support it for sms as well.

Regards,

Ankur
srikanthrathod
Explorer
0 Kudos
Hi Ankur,

I have followed your blog and I have created an Enhancement. But in my case it is Visit BO so in have added APPOINTMENT_ACTIVITY as the Meta Object name. But still I not able to view the enhancement name listed in custom recipient determination.

Can you please suggest ?

 

Regards,

Srikanth Rathod
0 Kudos
Hi Srikanth,

Ideally, it should work. I would suggest you to raise an incident stating all the details of the implementation you have done.

Regards,

Ankur
srikanthrathod
Explorer
0 Kudos
Hi Ankur,

 

Thanks for your quick reply.

Alright. I have just raised an Incident stating all the details.

 

Regards,

Srikanth Rathod
former_member712228
Discoverer
0 Kudos
Hi Ankur, It is great information. Thanks for sharing the knowledge. I have implemented the same for "Ticket" BO. With this approach, workflow is sending separate emails for each recipient added in  enhancement. Client is looking for kind of  "reply all" functionality. I mean one email to all the recipients. is there anyway can I achieve it? Like add all the emails in To line. Your help will be appreciated. Thanks.
former_member712228
Discoverer
0 Kudos
Hi Ankur,

I have enhanced "ExitForGettingWorkflowRecipients" for “Ticket” BO for custom recipient determination. With this approach, workflow is sending separate emails for each recipient added in enhancement. Client is looking for kind of “reply all” functionality. I mean one email for all the recipients. is there anyway can I achieve it? Like add all the emails in To line. Precisely client is looking to send one email for all custom recipients instead sending separate email for each recipient. Your help will be appreciated. Thanks.

 
former_member781956
Discoverer
0 Kudos

Hey everyone, can you guys help me?

I'm having an issue where the e-mail is sent twice to the customer account. It does work, but the customer is receiving duplicate e-mail.



Here is my code:



.fltr



.absl


 


.enht

0 Kudos
Hi leorsgomes,

Did you find the route case. I am also facing the same issue.

Thank you,

Chandrasekar Balan

 
reply_wiete
Explorer

Hello,

i am trying to use this Recipient Determination for a workflow on a custom business object. I am not able to retrieve the custom business object by the UUID, though. "Parameter type 'UUID' is not valid". Did i misconfigure my custom bo or is it not possible to retrieve custom bos by UUIDs ? Since the UUID is all i got from this Enhancement. I verified by OData, that i am able to alter BO instances of the Custom BO with the ObjectID, which i get from the InputData.TriggerBOUUID.

I would greatly appreciate an answer.

With kind regards

Lars Wiete

rafal_d
Explorer
0 Kudos

hello,

what will be proper Meta Object name in case of custom object?

The  determination works fine as long as I use standard BO - like with meta object COD_CONTACT.

But when I try to use custom by I do not see anything in Custom Recipient Determination table (in workflow definition). I tried to use entries in filter like 'custombo.bo' or simply 'custombo' but still it does not work.

regards

Rafal

reply_wiete
Explorer

Hi @rafal_d ,

i didn't use any filter for custom BO. You do need to have the notification element for your custom bo, though, to have it working with workflows.

This is my code in the absl file of the BADI:

import AP.Workflow.Global;
import ABSL;
import AP.PDI.bo;
import ESF;

var result : OutputStructureForWorkflowGetCustomRecipient;
var ls_agent : OutputStructureForWorkflowGetCustomRecipient.AgentUUID;
var ls_email : OutputStructureForWorkflowGetCustomRecipient.AgentEmail;

//8.3.24 Retourelabel Chatbot

var HU;
var count = 0;

if(!InputData.TriggerBOUUID.IsInitial())
{
	HU = HandlingUnit.Retrieve(InputData.TriggerBOUUID);
	if(HU.IsSet())
	{
		if(!HU.RetoureLabelChatbotEmail.IsInitial())
		{
			ls_email.content = HU.RetoureLabelChatbotEmail.content;
			result.AgentEmail.Add(ls_email);
		}
	}
}

return result;

I just pass an email address that is stored on the BO.
As i said, i did not put a filter in the fltr file, there is just the star entry.
I hope this helps.
Kind regards

Lars Wiete

rafal_d
Explorer
0 Kudos

Hello Lars,

It worked, however instead of star I simply removed all filters.

regards

Rafał

aizaz_k
Discoverer
0 Kudos

Hi,

How can we Acess KUT field in this program.. I have added reference obj the KUT field is appearing in debugger but when I am access it in veriable.

clovismuller
Active Participant
0 Kudos

Hello Experts!

I tried to implement as per the steps provided in this blog. As you mentioned here and the option named "Enhancement listed in custom recipient determination" was not showing up.

SOLUTION: The solution I found was to create the BADI (Business Add-In) with the below parameters:

1- Right-click on your PDI solution and click Add > New Item.
2- Select “Extension” from the tree on the left and select “Enhancement Implementation”.

clovismuller_0-1734024259063.png

After that, no additional configuration was needed in the workflow rule. The default setting was used: "Recipients Determined with Custom Logic".

Clóvis Müller

SAP Service Cloud 

@chackoanil - answering your question.

Labels in this area