cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow rules-No option to send email notification to individual customer

Former Member

Hi Experts,

I want to send email notification to an individual customer but I can’t find customer as recipient in recipient dropdown list

.

Can anybody help is it possible to add customer category in this drop down list? Is it possible to do this with the help of PDI, if yes then how by coding can do this?

Many Thanks!

Pragati

Message was edited by: Pragati Vermaagati

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Pragati!

In cases like this, you can create a workflow with Rule Type "Action".

Create a new action in the .xbo that sends an e-mail by code.

Use this action in the workflow.

Regards,

Alexandre.

former_member186648
Active Contributor
Former Member
0 Kudos

Hi Pradeep,

What about notification rules creation for custom BO? Because now we have the functionality to create custom notification rules. Is it possible to do this with that way?

Otherwise where should I start from? Like in my previous question regarding MDR I have created a custom BO to update a custom field with current system date in standard BO. System date is updating successfully daily but when I tried to make a workflow if current date is equal to DOB of customer then send notification to customer.

But unfortunately I can't find individual customer/customer as recipient in workflow. So this is the complete requirement which is partially fulfilled uptill now.

Can you plz. explain now how can I do this notification thing work?

Regards,

Pragati

Former Member
0 Kudos

Hi Alexandre,

Thanks for for your reply. I can't create action in customer xbo Neither my custom BO is visible in workflow. Can you plz. explain more clearly how can I do this?

Regards,

Pragati

Former Member
0 Kudos

Hello Pragati!

I thought the following:

1) Open Customer.xbo and create an action "action SendEmail";

2) Implement the "SendEmail" action to send email by code;
3) In "Define actions" tab of the workflow, select Rule type "Action";

4) Select the action "SendEmail".

Considering that, when your workflow conditions are true, it executes the action.

Could you share some screenshots with the error when creating the action?

Regards,

Alexandre

Former Member
0 Kudos

Thanks for sharing the steps. But I'm not able to create action in business object extension neither in root node nor in common node. How should I do as it is not possible to create custom action in xbo.

Regards,

Pragati

Former Member
0 Kudos

Hello Pragati,

Are you facing this error? EFS2 FrameWork?? | SCN

Maybe you cant create an action in this BO. I'll try to think in other solution =/

Sorry,

Alexandre.

former_member186648
Active Contributor
0 Kudos

Hi Pragati,

You cannot create action on a standard node of XBO, you should create extension node and then define action inside the extension node.

Creation of extension node is restricted, refer the following to know the restrictions:

http://scn.sap.com/docs/DOC-68053

Thanks, Pradeep.

Former Member
0 Kudos

Hi Pradeep and Alexandre Kaminagakura,

Is it possible to create a MDR that can send automated email to customers on their birthdays?

If yes, then how can we code that?

Regards,

Pragati

former_member186648
Active Contributor
0 Kudos

Hi Pragati,

Create Custom Business Object,
Create UI on the above BO,
Generate an instance of the BO,
Create MDRO on the BO (this will have action),
In the BO Action Query to get all the birthdays,
Check if the birthday is today, if yes, then send email.

Thanks, Pradeep.

Former Member
0 Kudos


Hi Pradeep thanks for replying.


Can you plz. explain where and how(in terms of coding) this " if " condition be defined?



Check if the birthday is today, if yes, then send email.


Regards,

Pragati

former_member186648
Active Contributor
0 Kudos

Hi Pragati,

Define the if condition in the MDRO's action.
MDRO reference link: https://scn.sap.com/community/business-bydesign/studio/blog/2014/04/03/how-to-create-an-hourly-mass-...

see second screenshot

To know the current date refer:

http://help.sap.com/saphelpiis_studio_1508/studio_od_1508.pdf
search for "Context.GetCurrentGlobalDateTime"

Former Member
0 Kudos

Hi Pradeep,

All I have seen in various blogs that people have only coded for Employees to send notifications to employees. Not for customers. I followed this code this is for employees again.

Can you plz. help me here to transform this code for customers, contacts of Accounts?

//Elements of Email

var emailActivityElements : elementsof EmailActivity;

var emailActivityMessageFromPartyElements : elementsof EmailActivity.Party;

var emailEmployeeResponsiblePartyElements : elementsof EmailActivity.Party;

var emailActivityCC : elementsof EmailActivity.Party;

var emailAcitivtyTo : elementsof EmailActivity.Party;

var emailActivityEmailActivity : elementsof EmailActivity.Party;

var emailActivityTextCollText : elementsof EmailActivity.TextCollection.Text;

var emailActivityTextCollTextTextCont : elementsof EmailActivity.TextCollection.Text.TextContent;

var employeeMailID;

var employee;

var employeeAdminMailID;

var emailActivityInstance;

employee = Employee.Identification.Retrieve(notification.Source);

if (employee.IsSet())

{

    if (employee.ToParent.CurrentDefaultEmployeeWorkplaceAddressInformation.IsSet())

    {

        var employeeWorkPlaceAddressInfo = employee.ToParent.CurrentDefaultEmployeeWorkplaceAddressInformation;

          if (employeeWorkPlaceAddressInfo.EmployeeWorkplaceAddressWorkplaceAddress.IsSet())

          {

                employeeMailID = employeeWorkPlaceAddressInfo.EmployeeWorkplaceAddressWorkplaceAddress.DefaultEMail.URI.content;

          }

      }

}

    //For display the subject accordingly

 

        emailActivityElements.Name.content = "Reg: Test Email";

        emailActivityInstance = EmailActivity.Create(emailActivityElements);

    // for assigning the To Party

    if (!employeeMailID.IsInitial())

    {

        emailAcitivtyTo.PartyKey.PartyID.content = employeeMailID;

        emailActivityInstance.MessageToParty.Create(emailAcitivtyTo);

    }

    else

    {

        raise Error/Info Messgaes accordingly

    }

    //TextCollectionTextTypeCode 10002 -> Body Text

    var TxtTypeCode = "10002";

    var emailActivityTxtCollIns = emailActivityInstance.TextCollection.Create();

    emailActivityTextCollText.TypeCode.content = TxtTypeCode;

    var emailActivityTxtCollTxtIns = emailActivityTxtCollIns.Text.Create(emailActivityTextCollText);

  

    //To Display the Message Note

        

        emailActivityTextCollTextTextCont.Text.content = "Dear Recipient," + "\n \n" +

        "Text Needed ";

    }

    var emailActTxtCollTxtTxtCont = emailActivityTxtCollTxtIns.TextContent.Create(emailActivityTextCollTextTextCont);

    //If Instance is Set then Send the mail

    if (emailActivityInstance.IsSet())

    {

        emailActivityInstance.Send();

    }

Many Regards,

Pragati

former_member186648
Active Contributor
0 Kudos

Hi Pragati,

1) You should change Employee.Identification.Retrieve to Customer.Retrieve and

2) Fetch email id from Customer BO Address(you could search where to fetch in SDK->Repository explorer->Customer)

Thanks, Pradeep.

Answers (0)