How to get entity column name dynamically on custom entity form on onload event. I have to fetch all the fields dynamicallly.
How to get entity column name dynamically on custom entity form on onload event. I have to fetch all the fields dynamicallly.
Nagaraju, could you please provide an example of the complete SQL? Thank you!
Naveen, could you please provide instructions on how to run this? I'm trying in SSMS but it doesn't seem to work. Thanks!
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.
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);
}
How to get entity column name dynamically on custom entity form on onload event. I have to fetch all the fields dynamicallly.
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,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156