SAP Knowledge Base Article - Public

3146269 - Best Practices for Workflows

Symptom

Workflows can you used to Automate your business processes. Configure to send notifications, trigger automatic e-mails and define conditions to update fields or calculated values. Also trigger actions or schedule workflows based on dates, time or other complex conditions. Workflows also allow you to create multi-step approvals.

Workflow configuration involves creating workflow rules that can trigger automatic e-mail messages, notifications, field updates and actions for business objects. Administrators can create workflow rules specifying actions/notifications/field updates for business objects, recipient groups, employees and so on. Workflows enhance the flexibility and adaptability of your Cloud for Customer solution to your custom business requirements.

Environment

To configure workflow rules, go to Administrator Work center--> Workflow Rules-->New . Using workflows,you can activate rules for updating fields, setup automatic notifications, trigger creating tasks, send e-mail notifications to customers and so on. The various configuration possibilities for workflows are described here. Workflow rules involve a five step process. These include Business Object, Timing, Conditions, Actions, Review and ConfirmatLon. These components determine how the workflows will be used in the various business processes.

Reproducing the Issue

wkf.PNG

Resolution

Steps to create Workflow: 

1. Select the business object for which rule applies

2. Decide on the timing, when the system should evaluate the rule. The three available options are,

>On Create Only (when the object is created)

>On Every Save (every time an object is saved)

>Scheduled (scheduled after an event occurs).

You can specify, for example, if a workflow rule be triggered when an object like a sales quote or ticket is created or when saved. There is also an option to schedule the rule for a specific time, for example two days before the due date of an item.

ConditionsConditions are the criteria which trigger workflow rules. These conditions may be standard fields, extension fields, field value change and so on. For example, if you create a sales quote above a certain value (the condition), the system triggers the associated action.

NOTE: You must maintain conditions in Groups. Maintain multiple conditions within a group if you need more than one criteria to be met for the workflow rule. Use separate groups to define OR conditions.

3. Decide what action the respective tasks should done when Workflow is triggered, such as E-mail, Messaging
For example, send an e-mail, generate a notification, send a text message or update a field of the object (both standard and extension fields as well as trigger an action). You can define actions using one of the supported rule-types namely the Notifications. To better understand how these actions are triggered, here are the basic steps your administrator takes to set up workflow:
-> Configure Workflow Timing:Administrators can configure when a workflow rule must be evaluated and triggered. Timing can be relative to create or change of a business object or can be scheduled
NOTE: The events listed in the field help are specific to a business object you have selected. Further, the business object selected can be enhanced with a custom field with data type as Date.
Recommendations:
  • Workflow rules that are set to with Timing - On Every Create or On Every Save are run synchronously while the transaction object is being created or saved in user session. Too many rules affect system performance. Therefore it is recommended that you consolidate these rules.
  • Use the Scheduled option as the scheduled rules run asynchronously and the conditions and actual workflow for scheduled rules are triggered outside the user session.
  • Note that workflow time affects all users using the business object within a process and define rules accordingly.
->Configure Workflow Conditions:Administrators can configure conditions to specify criteria that must be fulfilled in order to trigger workflow rules. Conditions can be based on standard fields, extension fields, field value change and so on.
NOTE: You can also create conditions using custom (adapted) fields. Set up any custom fields first, before you create your workflow rules.
->Configure Workflow Conditions: Messaging rules can be configured to send a formatted text message to the mobile device number registered in the master data of the recipients.
NOTE: 

1. All placeholders included in notification templates must be in all caps, contain no special characters, and begin and end with a hash tag (#).

For example: #ID# & #ACCOUNT# & #100#

2. Enable Messaging Workflows: Administrators must enable messaging before configuring messaging in workflows.

Maintain the following configuration:
Configure sender service: Go to Business Configuration>Implementation>Projects>Select your project and navigate to Edit Project Scope>Questions>Sales Account and Activity Management>Activity Management >Activity Types and select the scoping question: Do you want to record messaging activity?
Under Administrator>Mashup Web Services, create a mash-up web service to integrate to the SMS provider.

3.Track E-Mail and Messaging Activity: Any e-mail and messaging activity that you trigger using workflows can be tracked in the document flow for an object. This is possible because e-mail and messaging activities created through workflows are now linked to the source object.

Example:When creating workflows for sales order, if you select the Create E-Mail Activity flag, the e-mail activity is linked to the sales order and also available in the Document Flow and Activities tabs in the sales order.

4. When workflow rules impact fields from other business objects, then the authorization of the user triggering the workflow is not considered. For example, an administrator configures the workflow to update the account role from Prospect to Customer when the quote is converted to Won. The end user only has a read authorization to customer records even though the user has a create/update authorization of sales quote. When the user converts the quote to Won, the customer's role is updated to Customer even though the user does has no authorization to update customer record.

5. If you want to use predefined HTML templates for e-mail notifications, add HTML files to the list of allowed MIME types in the Allowed MIME Types for Document Upload fine-tuning activity.

6. Only parties with employee role can be used in the sender determination. If there are multiple employees assigned to a party role, the determination selects details of the first employee in the list.

7. All business partner roles are available for selection in the list. The complete selection list is dynamically added using code list and hence the values in the selection list can be modified. You can use the fields Top Level Account Owner and Top Level Account Team as filters to include only the parent company in a notification.

8. Only parties with employee role can be used in the sender determination. If there are multiple employees assigned to a party role, the determination selects details of the first employee in the list.

9. When creating workflows for sales order, if you select the Create E-Mail Activity flag, the e-mail activity is linked to the sales order and also available in the Document Flow and Activities tabs in the sales order.

10. You have the ability to attach the business object summary as PDF in an outgoing e-mailThis feature is possible only if a form template has been maintained for a business object and an e-mail template has been configured in the workflow configuration.

11. Send Notifications to Social Media Channels as WeChat,Facebook and Twitter: To receive these notifications, the contacts or users must register on the official social media account, that creates a social media user profile for the contact.

12. Configure workflow rules to send survey link through social messages: You must enable the "Value Before Object Change"while defining conditions to prevent multiple executions of the workflow.

13. Automate reply message to Facebook or Twitter users social post by configuring workflow:

Your user must enable "Value Before Object Change" while defining conditions to prevent multiple executions of the workflow.

14. Workflow rules of type Activity Task cannot be created for activity objects (appointments, tasks, phone calls, and visits).

15. Custom Actions on Standard Business Objects using Workflow Engine:You can use the workflow engine to configure custom actions and define when to trigger these custom actions.This allows you to leverage the scheduling capabilities of the workflow engine. It also allows administrators to modify the standard logic without having to modify the SDK code.

16. In a Approval scenario: When a quote was approved, the PrimaryApproval will be set to Yes with the. IF the is then changed again, the approval status will be changed from Approved to Not started. In this case, PrimaryApproval needs also to be reset as otherwise, the approval condition for VP will not be met.

17. In a condition group, if you have a condition for field "xyz" equal to "< $1m => Level 0 (Sales Director)" this will cause problem. 

When the description starting with "<" is maintained in a condition, we are having some limitation in the framework which is causing the dump. Currently its a limitation

Solution: To update the description which starts with "<". For example changing the description from "< $1m => Level 0 (Sales Director)" to "Less than $1m => Level 0 (Sales Director)". This has to be done for all the fields which contains description starting with "<".

Known Scenarios related to WorkFlows:

1. The "Function" field is not available as a condition when creating a workflow rule for object "Contact": 

Cause: It is a currently a  limitation (not all fields are available to be used)

Alternate solution:Customer can can also create conditions using custom (adapted) fields.

                              -Set up any custom fields first, before you create your workflow rules

                              -See "SAP Cloud for Customer Extension Guide", for more details

 2. How the Subject/Template Language is Determined for Workflow Rule:

Resolution: 

Language for workflow rule is determined as below sequence:

  1. If recipient has an user in system, the language would be first read from identity. To check this: Login with Recipient User ID. Go to Personalize->My Settings->Language.
  2. If recipient is not an user in system, but an existing Contact from a Business Partner (Account/Individual Customer), then system will consider the work address of the contact to get the email/phone and the comunication preference. In case the Contact is not associated to the account, system will consider the personal address and its preference.
  3. If recipient is not an user in system, but a Business Partner (Account/Individual Customer) or/and if the Contact Personal Address is empty, it will be derived from the Language field available within the Account. To check this: Go to Customers -> Accounts/Individual Customer ( Based on recipient is an Individual customer or it is associated with an Account) -> Language.
  4. If both Contact (Personal Address) or Business Partner (Language field) are not set, the email language will be defined according to the Language marked as "default" in workflow rule.

3.How To Activate Late Condition Evaluation For Workflow Rules: Only turn on the Late Evaluation after checking that we have the go-ahead from both customer and development side!. The late condition evaluation feature is only relevant for rules of type Field Update & Action.

Solution: Please create an Incident to SAP if it is required.

4. Cannot Define Workflow Rule Condition with Extension Field: You want to define a Workflow Rule with an extension field, but not able to find the specific field in the drop-down list under Define Conditions step

Cause: The Field Type Value of the extension field might be defined as URL. Workflow condition evaluation for field of type cannot support for URI (URL link, such as email address).

Resolution: You could change the Field Type of the extension field to other value, the supported values are: Text, Quantity, Time, Value Help.

Then it should come in drop down list while condition evaluation.

5. Workflow Rule Type field is not visible while it has been set to "Visible" under adaptation mode:Setting the "Rule Type" as visible in Adaptation Mode does not make the field visible in the UI.

Resolution: The system is working as designed.Workflow rules involve a five step process. See "Workflows" for more details.

The visibility of the "Rule Type" field is allocated to be under the "Define Actions" step, and not the "Enter Basic Data" step.

6. Scheduled Workflow Gets Triggered Despite The Conditions Having Changed: A scheduled workflow rule is triggered despite you having changed the object so that it no longer matches the conditions.

Resolution:This is the expected system behaviour. After the trigger for the execution of the WFR was started, it does not stop as the conditions for the trigger were met at the time the trigger was set off.

7. Incorrect Time Zone on Workflow E-Mails (e-mail notifications): You have created a workflow rule for an e-mail notification with a placeholder for the time and date of a visit. In the e-mail, the time is displayed with the wrong time zone.

Cause:

The system evaluates the recipient of the e-mail by their business partner role.
If the recipient has a business partner role in the system, the time zone is populated with the time zone maintained in the business partner's personal settings.
If the recipient does not have a business partner role in the system, the time zone defaults to UTC.


Resolution:

There are two options for any e-mail workflow rule with a placeholder for time.

If there are personal user settings for date/time format in the system, only maintain recipients that have a business partner role in the system.
If there are no personal user settings for date/time format in the system, you can define the date/time format and/or time zone during workflow creation.
Go to the Administrator work center.
Go to the Workflow Rules view.
Open the relevant rule.
Go to Actions.
Select All Languages in the subject line.
Result:You can maintain the date/time and/or time zone for each language template.The personal date/time user settings always take precedence over the time format defined in the workflow rule.

8. Workflow Logs To Workflow Rule of Type "Notification" Are Not Available: You have created the Workflow Rule ABC (ABC represents the Workflow Rule ID) that triggers notifications due some condition. The Workflow Rule is creating notifications successfully, but the log of the notification that has been triggered is not generated.

Cause:

For Workflow Rules of type Notifications no workflow logs will be available and log functionality is only for rule of type : Email, Field Update, Messaging and Action. This feature of which rule was evaluated (as seen in the log) is not yet made available for both Cloud for Customer and Business by Design. In Cloud for Customer, most rule types other than "Notification" have this workflow log enabled and hence the user will be able to see the log details.

Resolution:

This is the expected system behavior.

If this feature/functionality is required urgently, please refer to KBA 3475641 - Functionality Currently not Available.

9: Error while creating Survey as placeholder: You are trying to create a workflow rule on Appointment / Account / Individual Customer business object and wanted to send a survey, but you receive the below error
Referenced object BUSINESS_ACTIVITY is not supported / Referenced object Customer is not supported

Cause:

There are certain consistency checks done for survey related placeholders during design time from workflow side a failure of it will result in error message.

Resolution:

You can use surveys via workflows only for business activities of type Phone call and visit. You cannot use surveys for appointments or customers, etc.

1. If you are a partner: please use cloudsolutionpartner@sap.com or the Partnerfinder

2. If you are a customer: Contact your Account Executive or Check the link https://www.sap.com/uk/services/advisory-development.html

10. Error Message XXX Is Not a Valid Email Address in Workflow Rule: You notice that, when trying to create an e-mail workflow rule, the error message XXX is not a valid email address is displayed, after adding an e-mail address, although you have maintained the activity Address Checks, in Business Configuration work center, to allow the saving of inconsistent addresses.

Cause: The configuration set in the activity Address Checks, in the Business Configuration work center, is not applicable for workflow rules.

Resolution: This is the system expected behavior.

11. Workflow is not triggered by the Approval Action:A workflow rule which is set up to be triggered every time, on every save (example: Task to be created every time (Always Create Activity Task) on every save) is not triggered when the approval action is carried out.

Cause : The approval action does not trigger workflow rules.

Resolution: This is the system working as designed.

Keywords

Best practices for Workflows, Workflow, Issues with workflow, how to, Error workflow, , KBA , LOD-CRM-WKF , Workflow , How To

Product

SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions