Hi,
I have following Requirement in CRM:
I should show an error Message on Order Form as soon as the status of Order is "submitted".
I have tried to solve this with javascript but I've got an error:
var StateCodeValue = formContext.getAttribute ("statecode").getValue();
if(StateCodeValue == 1){
formContext.setNotification("xy ", "WARNING");
Can anybody say how can I get the value of Statecode?
Thanks in advance!
Thank you for your response!
Yes actually I passed the formcontext too:
function ShowError(executionContext){
var formContext = executionContext.getFormContext();
var StateCodeValue = formContext.getAttribute ("statecode").getValue();
if(StateCodeValue == 1){
formContext.setNotification("xy ", "WARNING");
} else {formContext.clearNotification("WARNING"); }
}
I've got an Error that my Webressource doesont exist. I dont know if my code line is correct for getting the StateCode value
Hi,
I hope you are passing the formcontext when calling this function.
do you see any error in console?
I would recommend you debug this script by putting "debugger;" at the begining of the code and publish.
post that just open developer tools by pressing f12 while you are on the page & it should trigger the code
you will be able to know which line is problem.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148