Notifications
Announcements
No record found.
Hi ,
I want to enable the java script on bulk edit form to disable some fields only when I'm performing the bulk edit.
Is there anyway to do this ?
*This post is locked for comments
Hi,
The simplest way is to make the fields as read-only in your default forms and make it editable via JavaScript on load. By doing this you can lock the field on bulk edit
Here is how you can do it with JavaScript.
function bulkEditFormLogic(bulkeditchk) { try { console.log("running bulkEditFormLogic:" + JSON.stringify(bulkeditchk)); console.log("Xrm.Page.ui value is null =" + (Xrm.Page.ui == null)); if (Xrm.Page.ui == null) { bulkeditchk.attemptnumber += 1; if (bulkeditchk.attemptnumber <= bulkeditchk.maxattempts) { setTimeout(bulkEditFormLogic, 1000, bulkeditchk); } } else { var ftype = Xrm.Page.ui.getFormType(); if (ftype == 6) { console.log("is bulk edit form"); //data from the parent form this bulk edit is being run from, these would have values if the bulk edit was being done in the associated grid of a form var entid = this.parent.frames[0].Xrm.Page.data.entity.getId(); var entname = this.parent.frames[0].Xrm.Page.data.entity.getEntityName(); //put your code here } } } catch (err) { console.log("Error in bulk edit logic=>" + err.message); } } //we have to run the bulk edit logic outside of a subscription since it doesn't observe subscriptions anymore bulkEditFormLogic({ "attemptnumber": 0, "maxattempts": 6 });
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2