Hi!
I want to set a field attribute on save - its an boolean field. Yet with entity metadata it wont work.
It is regarding the profile web form on the portal.
Could you help me out to solve this with javascript? (To set the value after I submitted/updated the form via click on the button)
Thanks!
Solved! Go to Solution.
Hi @newmay
Please use below code:
$("#bbg_approved").prop("checked", false);
$("#bbg_approved").closest("td").hide();
--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!
Hi @newmay
Please have a look at the following article
https://carldesouza.com/get-and-set-field-values-using-formcontext-and-javascript-with-dynamics-365/
Hope it helps.
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hey @ragavanrajan thanks!
So basically I can copy the code from the article, yet how do I combine it with the click on the button, since it is on the portal.
I need the field value to be set after the user clicks/submits the form on the portal.
Thanks
If the issues was just that you couldn't get Metadata to set it, it is possible you tried setting it 0/1 rather than true/false (Boolean wont take an index number like other option sets do).
Note: you can set it using JavaScript as suggested by Mira if the field is on the form and editable (hint: you may need to hide it with CSS or jQuery if you don't wan the user to see it)
HI @Mira_Ghaly thanks for reaching out!
I put the code with the fieldname into the Custom Javascript section within the "Additional Settings" Tab.
Yet it is still on the Profile Web Form
Your field is a two option, so it's likely you will have to select the relevant option via jQuery instead of setting a text value. You should also be able to set this via meta data. Try true/false if 1/0 did not work.
Hi @newmay
Please use below code:
$("#bbg_approved").prop("checked", false);
$("#bbg_approved").closest("td").hide();
--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.