2

I have a remote action that calls Apex class from OmniScript after 'Next' click. The logic in apex class is complex and might result in a situation where user can not move ahead in the omniscript flow and we need to show them an error message which is something as "You can not proceed ahead due to so-and-so reason". This is one of the scenarios, while at other times if the apex logic verifies that user can navigate to next step, we should allow user next step without an error message. Hence, I want to show conditional error message at omniscript level based on what is returned from Apex-Remote action. I could not find any OOB tool or documentation for such a scenario.

Here is me Data JSON AFTER remote action response comes back:

{
"language": "Multi-Language",
"type": "test",
"runMode": "preview",
"LanguageCode": "en_US",
"theme": "lightning",
"subType": "createOpportunity",
"timeStamp": "2024-07-01T12:36:47.117Z",
"userProfile": "System Administrator",
"userTimeZoneName": "America/Los_Angeles",
"userTimeZone": "-420",
"userCurrencyCode": "USD",
"userName": "[email protected]",
"localTimeZoneName": "Asia/Calcutta",
"oppName": "Opportunity for Test",
"Opportunity_Data": {
    "countriesOfOperation": "Algeria;American Samoa;Andorra",
    "regionsOfOperation": "Cross-Regions",
    "isHighPriority": "Yes",
    "noOfServiceLocations": "1-20"
},
"Opportunity_Response":{**//This is the new node attached after remote action response is received.**
    "message": "You can not move ahead",
    "result": "Error"
}

}

Things I've tried:

  1. Used Custom Error Message on Remote Action as described here.enter image description here

This Does not show any error message.

  1. Created a new step after Remote action, and added a text block in that, and tried to show message there. It's conditional view is derived as: enter image description here

This step text is never displayed. What am I missing here?

2
  • How did you put the element name when you are mentioning text block? When I mention the text block name it is not printing.
    – Shilpa
    Commented Aug 20 at 23:13
  • I don't get what do you want to do with name of text block. In my implementation, I am just conditionally rendering the step based on standard "Conditional view" properties of the "Step" in omni script based on data JSON node value.
    – Sarang
    Commented Aug 26 at 9:09

1 Answer 1

0

The 2nd approach has worked. It did not refresh earlier probably, or required multiple refreshes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .