Hi,
I have JavaScript on my form to disable a two-option field, based on the value of a lookup. Without putting the entire function here, basically I'm using:
Hi,
I have JavaScript on my form to disable a two-option field, based on the value of a lookup. Without putting the entire function here, basically I'm using:
Hi Sean,
Thanks for your details, I tried as you said and it is a known issue.
Toggle control is not recommended to use in D365 now, please use the default control instead.
Sorry for the inconvenience :(
Best Regards,
Leo
Hi, thanks for your reply!
A couple things:
1) I simplified the scenario for the purpose of highlighting the issue. In my actual solution, the custom code is doing quite a bit more heavy lifting and business rules can't even come close to handling it.
2) The issue isn't with the ability to lock and unlock a field at the field property level, I can do that easily enough in javascript. The issue is with the Toggle control. It looks like in your example, you didn't add the control, you just have the default yes/no box. I even tested this out with a business rule and it has the same issue. It properly unlocks and locks the field property, but the Toggle control itself remains inoperable. Add the Toggle control to your field and you will see what I mean.
Hi Partner,
About this requirement, I suggest you to use Business Rules instead.
For example I created a business rule to check if the account is "Fourth Coffee" then unlock the "Director Approval"(Locked in default as yours).
And let's have a try. When loading the form with no data in Account, the fields are locked as we expected.
Then we choose the right account, the Director Approval get unlocked.
And if we selected other wrong account, the Director Approval get locked again.
The business rule will always be available both in onloading the form or onchanging the field without refresh the form.
And in your case, there may be some mistake in your logic code, to find out the reason, please share your complete code here.
On the whole, using Business Rules to control the fields will be easier and more accurate than JS code now.
Best Regards,
Leo
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... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156