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:
- Used Custom Error Message on Remote Action as described here.
This Does not show any error message.
This step text is never displayed. What am I missing here?