web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

How to create the tabs,sections,fields in the existing form in dynamics 365(On-Premise) using JS

(0) ShareShare
ReportReport
Posted on by

I want to create the tab,sections for that tab and add some fields to that tab using Java script for my On-Premise 

Categories:
I have the same question (0)
  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    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.

    https://www.c2software.com/c2-blog/using-javascript-library-to-show-or-hide-a-tab-based-on-optionset-value.aspx

    2. We could use js code to call Dynamics 365 webapi to create fields in an entity with the entity's MetadataId .

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/create-update-entity-definitions-using-web-api

    community310.png

    Hope it helps.

    Best Regards,

    Leo

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    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

  • gdas Profile Picture
    50,091 Moderator on at

    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?

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

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.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans