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

What is a model in D365FO and how To create a model in D365FO - Online Training Course Part 5

0

what-is-a-model-in-D365-FO-and-how-to-create-a-model-in-D365-FO
As we know, the complete D365 Finance and Operation developments are based on these four terminologies Package, Model, Project, and Element. So as a developer you need to know processes how to create a model, how to update a model, and how to delete a model.

What is a Model in D365?

A model is a design-time concept. A particular model can contain multiple Visual Studio projects. Therefore, you can say it is a collection of projects and a single project can have all or subset of elements from originating model. 

However, the association of a project is only with a single model. It is basically a unit of development/customization. Metadata for models is stored locally on an XML file called a descriptor XML. Hence creating a model is a mandatory thing for any sort of customization.

A model is a group of elements, such as metadata and source files, that typically constitute a distributable software solution and includes customizations of an existing solution. A model is a design-time concept, for example, a warehouse management model or a project accounting model. A model always belongs to a package. A package is a deployment and compilation unit of one or more models. It includes model metadata, binaries, and other associated resources. One or more packages can be packaged into a deployable package, which is the vehicle used for deployment in runtime environments.

Suppose you have a requirement for developing or customizing a payroll solution, so what you will do? in this case, before starting the project or coding you have to create a model, you need to give a name for the model such as Payroll Model, then further all your customization or anything associated with this payroll solution development or any object you are creating as new such as Tables, Forms, EDT, Reports, etc… or extending already existing objects like CustTable, VendTable or anything will be based on the model  Payroll Model.

But here you don’t confuse the d365 model concept with the dot net c# model concept, that is another concept.

Where is Model Data Stored in D365?

Where is D365 Model Data Stored? In Visual Studio while we are creating a model or updating a model one new folder is created, and some files are in the AOSService folder, which contains the files to run Microsoft Dynamics 365 for Finance and Operations. In a cloud-hosted developer machine, you can look on the C drive, and find your new model folder under C:\AosService\PackagesLocalDirectory\<Your model Name>

Model = Collection of Components inside a Solution.

model-managment-in-d365


How to Create a model in D365?

Here I put some basic steps for creating a model in d365 using visual studio, in the next following articles I will show you how to create, update and delete a model. So how to create a model in d365?

To create a new model, follow these steps:

1. Open Visual Studio as admin.

2. On the Dynamics 365 menu, point to Model Management and select Create model

3. Give a model, publisher name, and other values

This is the basic way of creating a model in D365.

For example, here I created one model named D365SnippetModel,

What is a model in D365FO and how To create a model in D365FO


How to update a model in D365?

During the creation of a model, if any reference to any package is missed then it can be added through the Update Model parameters wizard. Here, I am trying to add the package Application Suite to the model Sample (created earlier).

Suppose you have created a model, the initial time you forgot or not added the reference packaged Ledger, while you are proceeding with project customization, you need to use the EDT object named AccountCategory, so in this case, you must update the model parameters, otherwise what will happen? visual studio will show some errors and you cannot proceed with the project. O in this case you follow these steps, 

Step 1: Launch the Update model parameters wizard (through path Dynamics 365 > Model Management > Update model parameters....).

Step 2: On the Update Model parameters page, select the required model in our example I have chosen the name to be Payroll Model. Click on Next.

Step 3: On the Select referenced packages page, select package in our case Ledger. Click on Next.

Step 4: On the Summary page, provides a brief glimpse of model details like model description, referenced packages, and so on.

How to delete a model in D365?

If you no more need a model in d365, you can delete the model. This is an easy process in d365. Before deleting a model, you must stop following services

Stop the AOS web service and Stop the Batch Management Service.

you can delete your model easily by deleting the model folder in this path below path "C:\AOSService\PackagesLocalDirectory”. after deleting the model, you need to refresh the models to reflect the changes in your d365 project, for this you go to,

Dynamics 365 menu, point to Model management and select Refresh models,

then finally you must synchronize the database.

In the next following articles, I will explain the above 3 activities create, update & delete operations associated with a model individually with examples. If this article helps you, please try to share your comment.

Post a Comment

0Comments
Post a Comment (0)