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.
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.
For this write the two lines of code as shown in the below figure.
When you execute the class, you will get the company address of the logged company on the screen as shown in the figure.
Sorry. I didn't understand.
ReplyDeleteadding Model reference with respect to methods in the class
Delete