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 Community / Blogs / Goshoom. NET Dev Blog / Simple metadata query in Po...

Simple metadata query in Powershell (D365FO)

Martin Dráb Profile Picture Martin Dráb 237,801 Most Valuable Professional

If I need to extra metadata of a D365FO application, my preferred way is the new metadata API. But sometimes the requirement is so simple that it’s sufficient to query source XML files directly.

For example, this all what’s needed to get a list of fields from a table (together with their types) and store it in a CSV file. It’s written in Powershell:

[xml]$xml = Get-Content $inputXmlFilePath
$xml.AxTable.Fields.AxTableField | select Name, ExtendedDataType, EnumType | Export-CSV $outputCsvFilePath -nti

It’s great for trivial cases like this. If I needed more details about fields or I had to take into account table extensions, for example, then the metadata API would be a better choice.


This was originally posted here.

Comments

*This post is locked for comments