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
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 });
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
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156