I have to fire a custom java script code for checking some required fields are blank or not in an entity on Sub-Grid plus (+) onClick event. If the required fields are blank then Sub-Grid (+) button will not open the form of related entity and also fire an alert message that those fields have to filled up.
So, could You please tell me that "How could I find the id of Sub-Grid plus (+) button and onClick event to fire the custom java script code" for validating the required field of a parent entity?
*This post is locked for comments
Hi,
I have done some RND for this requirement. I have got the solution and the approach is, We don't need to hide the plus (+) button of a SubGrid. You can go to the "Customized Command" of the selected button on which You are trying to fire any OnClick event such as alert. In that case You have to create 1 new "Enable Rule" where You will choose the "Customized Java Script function Rule" from the Web resource where You can simply write an alert() for testing and You have to associate that new "Enable Rule" with that "Customized Command" of that Button. I think alert() will work after clicking on the SubGrid plus button and also before opening the SubGrid Form.
Another option is you can inject your custom code before CRM + button event.
You can customize + button command, and call your own javascript and in that javascript after validation you can call CRM function.
Here is one example.. which is done on CRM button.. but you can do it same on sub grid + button.
mahadeomatre.blogspot.com/.../inject-your-code-before-crm-button.html
hope this will help..
Hi Arunabha,
You need to disable OOTB + button , create new button and fire JS function in the command action.
Please refer old thread -
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,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156