javascript - call a function attached to custom button on onload of CRM Form -


i trying add function each , every entity on save event. have added button application ribbon , shown on each , every entity , attached function it. have add function onsave of form without clicking button. here function:-

function test() {    alert("hello");    xrm.page.data.entity.addonsave(addmethod); } function addmethod() {    alert("i added"); } 

what needed add enable rule button command.

problem: need replace generic plugin registered on each , every entity update event javascript function.

solution:

  1. created solution custom webresource , application ribbon.

  2. with of ribbon workbench added button entity form.(button added application ribbon added each , every entity)

  3. added enable rule return false hide button :

    function enablerule() {     xrm.page.data.entity.addonsave(addmethod);     return false; }  function addmethod() {     //my logic } 

and logic replaced generic plugin server side code client side code :)

i know not supported way, had anyway. told team lead it, wanted in way. so, please, no comments on that.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -