Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

To fetch the entity column name dynamically on custom entity form

Posted on by 5

How to get entity column name dynamically on custom entity form on onload event. I have to fetch all the fields dynamicallly.

  • UMF-lw Profile Picture
    UMF-lw 15 on at
    RE: To fetch the entity column name dynamically on custom entity form

    Nagaraju, could you please provide an example of the complete SQL? Thank you!

  • UMF-lw Profile Picture
    UMF-lw 15 on at
    RE: To fetch the entity column name dynamically on custom entity form

    Naveen, could you please provide instructions on how to run this? I'm trying in SSMS but it doesn't seem to work. Thanks!

  • Nagaraj_Matta Profile Picture
    Nagaraj_Matta 55 on at
    RE: To fetch the entity column name dynamically on custom entity form

    Hi Greetings !

    with below query you can get all the fields those are placed on form.

    var allFormAttributes = Xrm.Page.getAttribute();

    you can loop this variable and work with each attriubute as you like.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    Naveen Ganeshe 3,393 User Group Leader on at
    RE: To fetch the entity column name dynamically on custom entity form

    Hi,

    You can use below code to fetch all the form fields:

    function getAllFields(executionContext) {
        debugger;
        var formContext = executionContext.getFormContext();
        var count = 0;
        formContext.data.entity.attributes.forEach(function (attribute, index) {
                debugger;
            var attributename = attribute.getName();
            console.log(attributename);
            count   1;
        });
        alert(count);
    }

  • shruti sinha Profile Picture
    shruti sinha 5 on at
    Query

    How to get entity column name dynamically on custom entity form on onload event. I have to fetch all the fields dynamicallly.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans