I want to create the tab,sections for that tab and add some fields to that tab using Java script for my On-Premise
I don't think so you will allow to create dynamics tab,section and fields. Better way to do manually and you can set visibility through JavaScript.
Hi ,
Unfortunately you can not add dynamically tab , section , field in dynamics CRM form . You need to do form design manually and its should be predefined.Above already suggested to do show hide controls as per your need.
May I know what exactly your business requirement?
Hi
If I understand your question correctly, you want to dynamically create tabs, sections, and fields using javascript. In other words, you are trying to do on-the-fly form customization which is normally not recommended and not very straightforward to do.
Normally this sort of requirement fits into a web resource. In a web resoruce, you can dynamically populate content and do any thing you want.
I would recommend you re-think about your solution.
If you definitely have to dynamically display tabs and sections and fields, as LeoAlt suggested, you could add all the tabs and sections and fields and control their visibility using Javascript.
Show/Hide Tabs
Xrm.Page.ui.tabs.get("tab1").setVisible(true/false);
Show/Hide Sections
Xrm.Page.ui.tabs.get("tabnname").sections.get("sectionname").setVisible(true/false);
Show/Hide Fields
Xrm.Page.getControl('field name ').setVisible(true / false);
If this won't be very useful for your scenario, like I mentioned above, please consider using an HTML web resource and dynamically creating the content.
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/create-edit-web-resources
Good day asgvf,
1. It's a very hard work to add sections or tabs in a form by js because you should get the position where you want to insert your new tab first and then you should use js code to insert the html code of the tab into the form content :-(.
So if you want to control the visibility of tab/section, you could use js code to do this easily.
2. We could use js code to call Dynamics 365 webapi to create fields in an entity with the entity's MetadataId .
Hope it helps.
Best Regards,
Leo
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,104 Most Valuable Professional
nmaenpaa 101,156