Announcements
Hi all
I've 4 custom fields in my crm
there is a "business rule" that makes data fields mandatory when the bottom left field is set to "yes"; this work well.
With a javascript I would set the data fields at today, below screenshot of event and javascript.
When I set field value on YES, program show this error:
Can someone help me to find where I'm mistaken?
Thans in advance
Hi a33ik
thank you very much ... you are the real guru :-) ... now works.
here the script if it can help someone.
Then replace TRsn === 1 with just TRsn and TRsn === 0 with !TRsn.
Those fields:
Are those datetimes, whole number, string, optionset, booleans? One by one, please.
Hi a33ik
as you have for sure understood, I'm not so good with javascript and its concepts ... how can I do that?
Ok. Can you provide types of fields you're getting using getValue?
Hi KalpanaNadar
with https://jshint.com/ I find some error on brackets ... I'm not so good with javascript and its concepts ... what do you mean with "check if you are passing the executionContext while calling the SetDateToday function"?
Hi a33ik thanks for link ... very useful tool.
but after corrections the program not show errors, but dont set the date fields ... below the control
Hi DIE PIC,
I would request you to check if you are passing the executionContext while calling the SetDateToday function.
And also try to edit this code in visual studio and verify all the braces are closed properly and function syntax is correct.
As the error "Web resource method does not exist" we get only when the function is missing braces or any syntax error in the script and the function is not referenced correctly while calling it.
Ok. Now I see what is happening. Your code is invalid. Check the following lines:
you don't have the closing bracket.
and here
and there
and even there
One more thing:
you have try, you don't have catch.
I would recommend to check your code for syntax errors here - https://jshint.com/
André Arnaud de Cal...
293,302
Super User 2025 Season 1
Martin Dráb
232,114
Most Valuable Professional
nmaenpaa
101,156
Moderator