Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

Our blog provides a curated collection of tips, tricks, and code snippets that streamline your workflow and enhance your proficiency.
Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

How to get the Company Address Using X++ in D365

2

How to get Company Address Using X++ in D365

In this article, I am writing the x++ code for getting the company address with two lines of code. If you are a beginner or new to dynamics 365 Finance & Operations, you can use Microsoft Free Virtual Machine. Learn How to Set Up a Free Virtual Machine for Dynamics 365 Development

In D365, it is easy to write codes for getting the company or legal entity address using x++ programming. For executing and testing the project you create a class (Runnable Job) and write the below code inside the main method of the Runnable class.

Here I have created one model with the name D365SnippetsModel and added one project with the name LegalEntityProject and added one class (Runnable Job) named LegalEntityDetails. 

How to get the Company Address Using X++ in D365

Here the runnable class will execute and show an output of the company address that you have currently logged in, for example, if you have logged in to the company Contoso Entertainment System (USMF), the output will be the address of the same company as shown in the below image.

How to get the Company Address Using X++ in D365


For this write the two lines of code as shown in the below figure.

How to get the Company Address Using X++ in D365

When you execute the class, you will get the company address of the logged company on the screen as shown in the figure.

How to get the Company Address Using X++ in D365


Some Useful Links

Post a Comment

2Comments
  1. Sorry. I didn't understand.

    ReplyDelete
    Replies
    1. adding Model reference with respect to methods in the class

      Delete
Post a Comment