Hi Folks,
As we know D365FO comes with a powerful architecture for all integration using DIXF. Data entities are the only way (in most of the cases) to communicate with D365FO through an external system.
In today’s post, I’m going to share a quick tip on how to set default fields to be made available while using Excel add-ins for CRUD operation. Yes, now you can use excel add-ins to perform all CRUD operation on a user interface. Let's take the example of customer master.
Below screenshot shows how to access excel add-ins on customer master. Go to Customer master and on right-hand side upper corner, you may found Office icon. Click on it and select
It will show you all the data entities which are available in the system based on customer (CustTable) as the main data source. Select the first one,
and it will open an excel sheet with Dynamics Add-ins. You might need to sign in using a valid user which have access to D365Fo application. Excel must look like below with a Dynamics add-ins in left.
You can perform all CRUD operation here and hit publish button on the left down side to publish your changes to the server. That’s it.
Now coming to the title of this post, (it's not too late ) if you want to make any changes on these fields, like remove and add new or want to change the order, here is the trick.
Go to visual studio, open the data entity (in this case you need to create an extension of this entity). Go to field group > AutoReport. Here you must get all field which is showing on excel. You can do addition, delete, change the order of fields and that’s it. Once successful build changes will reflect when you use excel add-ins next time.
Cheers,
Harry
Search This Blog
December 21, 2018
December 13, 2018
[Solved]Error while code check-in in visual studio ‘Could not find file….’
Hi Folks,
Here is a quick trick. I was trying to check-in a few objects in a solution and encounter a strange error.
Error:
Could not find file 'C:\Users\Adminbefabcsd4\Documents\Visual Studio 2015\Projects\<MySolution>\<MyProject>\<MySolution>.btproj
Possible reason: If you are trying to check-in your object along with the solution file, you might get this error.
Possible solution: I cannot say it a permanent fix as I didn't find any technical reason for this, but below fix worked for me.
If you didn't make any changes in the solution itself, like adding/deleting a file, you should not include solution file in included changes. Remove solution file and check-in only object which you actually made changes.
Cheers!!!
Harry
December 11, 2018
Create delivery address run time
Folk,
Here is quick code to create the delivery address on runtime. You can use this on Purchase Requisition, Purchase order or a person.
So we are going to use LogisticsPostalAddressEntity to get the right address with a new one or an existing one. This code should also handle if there is any update in any existing record by updating effective date stamp.
Have a look on below code,
Give a try and share your feedback.
Cheers!!!
Harry.
Here is quick code to create the delivery address on runtime. You can use this on Purchase Requisition, Purchase order or a person.
So we are going to use LogisticsPostalAddressEntity to get the right address with a new one or an existing one. This code should also handle if there is any update in any existing record by updating effective date stamp.
Have a look on below code,
Give a try and share your feedback.
Cheers!!!
Harry.
November 15, 2018
[Solved]D365 FO data entity Synch error
[Updated on: Feb 26, 2020]
Hi Folks,
This quick post about one of the error while working on Data entities,
Error message: Severity Code Description Project File Line Suppression State Error ---> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'I_65518FIELD'. Cannot insert duplicate key in object 'dbo.SQLDICTIONARY'. The duplicate key value is (<tableId>, <FieldId>, 1, 0). 0
Other error messages:
Severity
|
Code
|
Description
|
Error
|
(20594,13,1,'SupplierContractId','SUPPLIERCONTRACTID',0,20,0,0,0,0);
|
|
Error
|
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.RunSync(SyncOptions options)
|
|
Error
|
at Microsoft.Dynamics.AX.Framework.Database.Tools.SyncEngine.PartialSync()
|
|
Error
|
at Microsoft.Dynamics.AX.Data.Management.ManagedSyncTableWorker.ExecuteModifyTableViaAlterTable(AxTable newTableSchema, IndexListCache ignoreIndexListCache, IncrementalSyncTableSchemaBuilder tableSchemaBuilder)
|
|
Error
|
Database execution failed: Violation of PRIMARY KEY constraint 'I_65518FIELD'. Cannot insert duplicate key in object 'dbo.SQLDICTIONARY'. The duplicate key value is (20594, 4, 1, 0).
|
|
Error
|
at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.SqlCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
|
|
Error
|
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
|
|
Error
|
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.RunPartialTableSync(SyncOptions options, String sqlConnectionString, IMetadataProvider metadataProvider)
|
|
Error
|
at Microsoft.Dynamics.AX.Data.Management.DBExecute.ThrowOnSqlExecuteException(SqlException e, String commandText)
|
|
Error
|
at Microsoft.Dynamics.AX.Data.Sql.SqlDataAccessManager.HandleException(ExceptionDispatchInfo edi, SqlExecutionInfo execInfo)
|
|
Error
|
Inner exceptions:
|
|
Error
|
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
|
|
Error
|
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
|
|
Error
|
at Microsoft.Dynamics.AX.Framework.Database.Tools.LegacyCodepath.ExecuteWithinAOS(SyncOptions syncOptions, String sqlConnectionString, IMetadataProvider metadataProvider, Func`1 func, Action`1 errorHandler)
|
|
Error
|
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
|
Possible solution: Delete all fields from the staging table and regenerate the same through right-clicking on data entity, refer below.
Another thing you should try is, to delete any data import/export project which you may have created while testing.
Now rebuild your solution and try.
Cheers!!!
Harry
November 04, 2018
[Solved] Error while Sales order Invoice
Hi Folks,
This quick post is about an error while posting a sales order. For functional they know where is the missing piece but if you need some process to test one of your development, I would suggest to dig yourself before asking a functional folk.
Error: Account number for transaction type Cost of goods sold, invoiced does not exist.
Reason: Inventory posting have missing setup:
Solution: Go to Inventory > Setup> Posting > Posting
Check if the respective setup is missing. If yes Add record accordingly.
That’s it.
Cheers
Harry
This quick post is about an error while posting a sales order. For functional they know where is the missing piece but if you need some process to test one of your development, I would suggest to dig yourself before asking a functional folk.
Error: Account number for transaction type Cost of goods sold, invoiced does not exist.
Reason: Inventory posting have missing setup:
Solution: Go to Inventory > Setup> Posting > Posting
Check if the respective setup is missing. If yes Add record accordingly.
That’s it.
Cheers
Harry
October 28, 2018
How to get list of installed Packages/Model/Hotfix
Hi Folks,
Let's see how to get details on installed packages and their model and metadata hotfix detail on an environment (non-production in case of hotfix details). There are different way available to get these list. I will show you simpler one for the quick purpose, at the end of post I will share few links with some PowerShell stuff (really cool) to get more detail around the same.
1. Installed Packages and respective model with version number
Open your application and click on gear icon > About
Expand the node ‘Loaded package and their model’, you will get the list to see installed packages and further drilling will give to respective model and version details.
2.Installed metadata hotfix, (Click here to check how to install metadata hotfix)
To get this list go back to your DEV box VM and open Visual Studio as admin. Go to Dynamics 365 menu > Addins > Apply hotfix
This will open a new window, select ‘View Installed Hotfixes’ tab
Here module refers to Packages while Model is same as std Model in a Package.
Here are few more helpful posts
1.. https://blogs.msdn.microsoft.com/axsupport/2016/09/07/find-which-hot-fixes-kbs-you-have-installed-in-microsoft-dynamics-ax/
2. http://yetanotherdynamicsaxblog.blogspot.com/2018/01/list-hotfixes-using-powershell-in.html
Cheers
Harry.
Let's see how to get details on installed packages and their model and metadata hotfix detail on an environment (non-production in case of hotfix details). There are different way available to get these list. I will show you simpler one for the quick purpose, at the end of post I will share few links with some PowerShell stuff (really cool) to get more detail around the same.
1. Installed Packages and respective model with version number
Open your application and click on gear icon > About
Expand the node ‘Loaded package and their model’, you will get the list to see installed packages and further drilling will give to respective model and version details.
2.Installed metadata hotfix, (Click here to check how to install metadata hotfix)
To get this list go back to your DEV box VM and open Visual Studio as admin. Go to Dynamics 365 menu > Addins > Apply hotfix
This will open a new window, select ‘View Installed Hotfixes’ tab
Here module refers to Packages while Model is same as std Model in a Package.
Here are few more helpful posts
1.. https://blogs.msdn.microsoft.com/axsupport/2016/09/07/find-which-hot-fixes-kbs-you-have-installed-in-microsoft-dynamics-ax/
2. http://yetanotherdynamicsaxblog.blogspot.com/2018/01/list-hotfixes-using-powershell-in.html
Cheers
Harry.
October 22, 2018
Extensibility changes in Dynamics 365 for Finance and Operations version 8.1.1
Hi Folks,
Check out this link for the new very useful update on extensibility on D365FO.
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/extensibility-changes-811
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
Check out this link for the new very useful update on extensibility on D365FO.
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/extensibility/extensibility-changes-811
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
October 20, 2018
[SOLVED] Error while get latest on source control Dynamics365FO
Hi Folks,
One of our customers have few ISV and while do a get latest on source control, the system throws an error of permissions and post that nothing works.
The quick fix I found is
1. Stop all below services on dev box,
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
One of our customers have few ISV and while do a get latest on source control, the system throws an error of permissions and post that nothing works.
The quick fix I found is
1. Stop all below services on dev box,
IIS Admin
MS Batch server
MS DIXF server
Management reporter
World wide web
2. Do a get latest
3. Build the entire application with DB synch.
4. Turn on all these services back.
That's it. :)
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
October 15, 2018
Table Event handler methods in Dynamics 365 FO
Hi Guys,
In my last post Form Event hander methods in Dynamics 365 FO, we discussed different event handlers which available on Form. Let’s continue this discussion with Table event handler method today.
Let’s see the different type of event handler in today’s post.
You need to add a new class to write the event handler methods. I would recommend adding one class to one table. To make it easy for another developer postfix the name by EH or eventHander or Hander so your teammate can identify if they need to add more business logic than create a new class from scratch.
1. Table onValidateField event handler
2. Table OnValidated event hander (same logic you can try for many other event hander)
[DataEventHandler(tableStr(InventLocation), DataEventType::ValidatedField)]
public static void InventLocation_onValidatedField(Common sender, DataEventArgs e)
{
InventLocation inventLocation = sender as InventLocation;
ValidateFieldEventArgs fieldArgs = e;
boolean ret;
InventLocation inventLocationLoc;
switch(fieldArgs.parmFieldId())
{
case fieldNum(InventLocation, field1):
if(inventLocation.MyWorkerAssociate != '')
{
<Your code/ business ogic/validation>
<ret = true or false>
fieldArgs.parmValidateResult(ret);
}
}
}
Let me know if it helps you or you got some more example.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
In my last post Form Event hander methods in Dynamics 365 FO, we discussed different event handlers which available on Form. Let’s continue this discussion with Table event handler method today.
Let’s see the different type of event handler in today’s post.
You need to add a new class to write the event handler methods. I would recommend adding one class to one table. To make it easy for another developer postfix the name by EH or eventHander or Hander so your teammate can identify if they need to add more business logic than create a new class from scratch.
1. Table onValidateField event handler
2. Table OnValidated event hander (same logic you can try for many other event hander)
[DataEventHandler(tableStr(InventLocation), DataEventType::ValidatedField)]
public static void InventLocation_onValidatedField(Common sender, DataEventArgs e)
{
InventLocation inventLocation = sender as InventLocation;
ValidateFieldEventArgs fieldArgs = e;
boolean ret;
InventLocation inventLocationLoc;
switch(fieldArgs.parmFieldId())
{
case fieldNum(InventLocation, field1):
if(inventLocation.MyWorkerAssociate != '')
{
<Your code/ business ogic/validation>
<ret = true or false>
fieldArgs.parmValidateResult(ret);
}
}
}
Let me know if it helps you or you got some more example.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
September 23, 2018
RecordInserList class for optimized insert operation
Hi Folks,
RecordInsertList class is the really useful and fastest way to
insert records in AX table(s). This method is useful you don't want to run any
validation while insertion for an example; insert in a temp table or
SSRS reports.
Below is the simplest example of set based
RecordInserList class,
void copyVendor()
{
VendTable sourceVend;
MyTmpTable targetVend;
//RecordInserList calss decarion
RecordInsertList VendList;
//Object initialization
VendList = new RecordInsertList(tableNum(Vendtable));
while select sourceVend
where sourceVend.vendgroupId == ‘Local’
{
targetVend.data(sourceVend);
targetVend.vendorAccount = sourceVend.vendorAccount;
.
.
.
.
VendList.add(targetVend);
}
VendList.insertDatabase(); //mandatory call
}
Another example from MSDN
public void tutorialRecordInsertList()
{
MyTable myTable;
RecordInsertList
insertList = new RecordInsertList(
myTable.TableId,
True);
int i;
for ( i = 1; i
<= 100; i++ )
{
myTable.value = i;
insertList.add(myTable);
}
insertList.insertDatabase();
}
RecordInserList class will capture all record in temp and hit The DataBase only once when we call insertDatabase(). add() insert certain
blocks followed by insertDatabase to complete the insert operation.
This is how we can reduce the SQL call and optimize the
performance as well.
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
September 09, 2018
Form Event handler methods in Dynamics 365 FO
Hi Guys,
Let’s discuss today the different event handlers in Dynamics 365 FO. Now we don't have the leverage 😉to overwrite existing code anymore so all you have is event handlers to manipulate standard functionality. However, event handlers were available in the earlier version as an optional and best practice but now it’s the only option. I will be sharing different event handler so we can cover most of the methods with different parameters.
1. Form dataSource event handler: Here I will be using the vendTable form to get table buffer and perform additional business logic or validation.
Vendtable = Form name
vendTable = form data source name
[FormDataSourceEventHandler(formDataSourceStr(Vendtable, vendTable), FormDataSourceEventType::Written)]
public static void vendTable_OnWritten(FormDataSource sender, FormDataSourceEventArgs e)
{
FormRun form = sender.formRun();
FormDataSource vendTable_ds = form.dataSource(formDataSourceStr(Vendtable,Vendtable)) as FormDataSource;
Vendtable Vendtable= vendTable_ds.cursor();
<Now to got table buffer, perform business logic/validation>
}
lets see one more example below;
2. Form DataSource while closing the form (same will apply for OnInitialized,
[FormEventHandler(formStr(EcoResAttributeValue), FormEventType::Closing)]
public static void EcoResAttributeValue_OnClosing(xFormRun sender, FormEventArgs e)
{
FormDataSource ecoResProduct_ds = sender.dataSource(formDataSourceStr(EcoResAttributeValue, EcoResProductAttributeValue));
EcoResProductAttributeValue ecoResAttributeValue = ecoResProduct_ds.cursor();
<YOUR CODE>
}
3. Post-event hander of Form init or any other standard method method
[[PostHandlerFor(formStr(Ledger), formMethodStr(Ledger, init))]
public static void Ledger_Post_init(XppPrePostArgs _args)
{
#ISOCountryRegionCodes
FormRun form = _args.getThis();
FormDesign design = form.design();
FormControl revaluationAccount = design.controlName(formControlStr(Ledger, revaluationAccount));
FormControl currencyRevaluation = design.controlName(formControlStr(Ledger, currencyRevaluation));
<your code>
}
4. Form control event hander:
[FormControlEventHandler(formControlStr(LogisticsPostalAddress, Roles), FormControlEventType::Modified)]
public static void Roles_OnModified(FormControl sender, FormControlEventArgs e)
{
FormRun element = sender.formRun();
FormControl purposeCtrl = element.design().controlName(formControlStr(LogisticsPostalAddress, Roles));
FormDataSource logisticsLocation_DS = element.dataSource(formDataSourceStr(LogisticsPostalAddress, LogisticsLocation));
<business logic>
}
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
Let’s discuss today the different event handlers in Dynamics 365 FO. Now we don't have the leverage 😉to overwrite existing code anymore so all you have is event handlers to manipulate standard functionality. However, event handlers were available in the earlier version as an optional and best practice but now it’s the only option. I will be sharing different event handler so we can cover most of the methods with different parameters.
1. Form dataSource event handler: Here I will be using the vendTable form to get table buffer and perform additional business logic or validation.
Vendtable = Form name
vendTable = form data source name
[FormDataSourceEventHandler(formDataSourceStr(Vendtable, vendTable), FormDataSourceEventType::Written)]
public static void vendTable_OnWritten(FormDataSource sender, FormDataSourceEventArgs e)
{
FormRun form = sender.formRun();
FormDataSource vendTable_ds = form.dataSource(formDataSourceStr(Vendtable,Vendtable)) as FormDataSource;
Vendtable Vendtable= vendTable_ds.cursor();
<Now to got table buffer, perform business logic/validation>
}
lets see one more example below;
2. Form DataSource while closing the form (same will apply for OnInitialized,
[FormEventHandler(formStr(EcoResAttributeValue), FormEventType::Closing)]
public static void EcoResAttributeValue_OnClosing(xFormRun sender, FormEventArgs e)
{
FormDataSource ecoResProduct_ds = sender.dataSource(formDataSourceStr(EcoResAttributeValue, EcoResProductAttributeValue));
EcoResProductAttributeValue ecoResAttributeValue = ecoResProduct_ds.cursor();
<YOUR CODE>
}
3. Post-event hander of Form init or any other standard method method
[[PostHandlerFor(formStr(Ledger), formMethodStr(Ledger, init))]
public static void Ledger_Post_init(XppPrePostArgs _args)
{
#ISOCountryRegionCodes
FormRun form = _args.getThis();
FormDesign design = form.design();
FormControl revaluationAccount = design.controlName(formControlStr(Ledger, revaluationAccount));
FormControl currencyRevaluation = design.controlName(formControlStr(Ledger, currencyRevaluation));
<your code>
}
4. Form control event hander:
[FormControlEventHandler(formControlStr(LogisticsPostalAddress, Roles), FormControlEventType::Modified)]
public static void Roles_OnModified(FormControl sender, FormControlEventArgs e)
{
FormRun element = sender.formRun();
FormControl purposeCtrl = element.design().controlName(formControlStr(LogisticsPostalAddress, Roles));
FormDataSource logisticsLocation_DS = element.dataSource(formDataSourceStr(LogisticsPostalAddress, LogisticsLocation));
<business logic>
}
Cheers,
Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
August 12, 2018
Edit/Display or new methods on standard application objects
Hi Folks,
Let’s see how to write a new method on standard application object using the extension framework. An extension enables you to add functionality to existing model elements and source code.
Before starting adding new method, you need to create a new extension class for your object and this class should be declared as final and post fixed by ‘Extension’ keyword. See below example,
For Table:
[ExtensionOf(tableStr(CustTable))]
final class MyCustTable_Extension
{
<new methods>
}
For Class:
[ExtensionOf(classStr(CustExchAdj))]
final class MyCustExchAdj_Extension
{
<new methods>
}
For Form:
[ExtensionOf(formStr(VendParameters))]
final class MyVendParameters _Extension
{
<new methods>
}
Now lets see how to add different types of methods
1. New edit method
For Extension methods, the first argument in method parameter must be the object you're extending e.g. table buffer. See below code for reference;
public static edit str60 MyFieldEdit(<tableName> _this, boolean _set, name value)
{
MyTable mytable = <tablename>;
if(_set)
{
if(value)
{
ttsbegin;
custTable = CustTable::find(<tablename>.CustAccount,true);
custTable.Name = value;
custTable.update();
ttscommit;
}
}
}
2. New display method
public static display EcoResDescription productName(InventSum _this)
{
Return _this.itemName();
}
3. Normal method
In the same way, you can write a new method, this method also needs to be static so it can be accessed on the form.
Public static updateSearchName(_this, Name _newName)
{
Mytable mytable = _this;
If(_newname)
{
Ttsbegin;
Mytable.searchName = _ newname;
MyTable.update();
Ttscommit;
}
}
Edit method on table extension or new methods on table extension, all method needs to be static. Now to access these methods, go to your form and add new field type of string/real/XYZ. Set below property
Cheers,
Harry
Let’s see how to write a new method on standard application object using the extension framework. An extension enables you to add functionality to existing model elements and source code.
Before starting adding new method, you need to create a new extension class for your object and this class should be declared as final and post fixed by ‘Extension’ keyword. See below example,
For Table:
[ExtensionOf(tableStr(CustTable))]
final class MyCustTable_Extension
{
<new methods>
}
For Class:
[ExtensionOf(classStr(CustExchAdj))]
final class MyCustExchAdj_Extension
{
<new methods>
}
For Form:
[ExtensionOf(formStr(VendParameters))]
final class MyVendParameters _Extension
{
<new methods>
}
Now lets see how to add different types of methods
1. New edit method
For Extension methods, the first argument in method parameter must be the object you're extending e.g. table buffer. See below code for reference;
public static edit str60 MyFieldEdit(<tableName> _this, boolean _set, name value)
{
MyTable mytable = <tablename>;
if(_set)
{
if(value)
{
ttsbegin;
custTable = CustTable::find(<tablename>.CustAccount,true);
custTable.Name = value;
custTable.update();
ttscommit;
}
}
}
2. New display method
public static display EcoResDescription productName(InventSum _this)
{
Return _this.itemName();
}
3. Normal method
In the same way, you can write a new method, this method also needs to be static so it can be accessed on the form.
Public static updateSearchName(_this, Name _newName)
{
Mytable mytable = _this;
If(_newname)
{
Ttsbegin;
Mytable.searchName = _ newname;
MyTable.update();
Ttscommit;
}
}
Edit method on table extension or new methods on table extension, all method needs to be static. Now to access these methods, go to your form and add new field type of string/real/XYZ. Set below property
Cheers,
Harry
August 03, 2018
Change a person on User in Dynamics 365 FO
Hi Folks,
Recently I uploaded my first video on youtube regarding a basic thing, I hope you will like it.
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
Recently I uploaded my first video on youtube regarding a basic thing, I hope you will like it.
-Harry Follow us on Facebook to keep in rhythm with us. @Facebook
July 14, 2018
Solution: Best practice (BP) warning suppression in Dynamics 365 FO
Hi Folks,
In this post, we will discuss how to suppression the best practice warnings while development. It's always recommended to remove/fix all best practice warnings before check-in your code to VSTS. To see all the BP warnings on your project; right click on the project and select Run Best practice Fixer on <Project name>
This step will show all the BP warnings for the selected project. Let's see what all the ways we have to fix these.
1. In code itself:
Add suppression line before your method, with warning type and justification, the syntax is below
[SuppressBPWarning(‘<BPWarningType>’, <Description/Justification>.)] for example [SuppressBPWarning(‘BPParameterNotUsed’, Parameter required by the event interface.)].
This is an example for the same.
2. Edit Best Practice Suppression file (AxIgnoreDiagnosticList)
Every model should have a BP suppression file named AxIgnoreDiagnosticList, for system models, you can find related BP suppression file at
K:\AosService\PackagesLocalDirectory\<ModelName>\<ModelName>\AxIgnoreDiagnosticList
Right-click on your project and select ‘Edit Best practice Suppression’. For all system models, this action will open the related BP suppression file.
For a new model:
In case you created a new model for your development (of course you would ) you have to create this file manually the first time, and on a later stage, you can amend for all BP fixes.
Create a new XML file under below path, I recommend to use a separate Visual studio instance for Create OR Edit this file.
K:\AosService\PackagesLocalDirectory\<yourModel>\<YourModel>\AxIgnoreDiagnosticList
Copy paste below
<?xml version="1.0" encoding="utf-8"?>
<IgnoreDiagnostics>
<Name>myModel_BPSuppressions</Name>
<Items>
<Diagnostic>
<DiagnosticType>BestPractices</DiagnosticType>
<Severity>Warning</Severity>
<Path>dynamics://<warning path></Path> //You can get this path from warning message
<Moniker>BPParameterNotUsed</Moniker> //You can get this from error message
<Justification>FormDataSourceEventArgs e is mandatory parameter for events and not used in the current context.</Justification>
</Diagnostic>
</Items>
</IgnoreDiagnostics>
Keep adding below tag for every warning
<Diagnostic>
<DiagnosticType>BestPractices</DiagnosticType>
<Severity>Warning</Severity>
<Path>dynamics://<warning path></Path> //You can get this path from warning message
<Moniker>BPParameterNotUsed</Moniker> //You can get this from error message
<Justification>FormDataSourceEventArgs e is mandatory parameter for events and not used in the current context.</Justification>
</Diagnostic>
</Items>
</IgnoreDiagnostics>
Some recommendations:
1. Best would be to create a new file using VS and place in the respective folder. Also, while adding new records best would be to edit this file from separate VS instance rather than same solution explorer.
2. You will find the BPWarningType in the warning message. If you not sure about the justification OR if you want to make consistency with system existing BP suppression, see the standard code.
3. I recommend using a separate Visual studio instance for Create OR Edit this file.
Cheers
Harry…
In this post, we will discuss how to suppression the best practice warnings while development. It's always recommended to remove/fix all best practice warnings before check-in your code to VSTS. To see all the BP warnings on your project; right click on the project and select Run Best practice Fixer on <Project name>
This step will show all the BP warnings for the selected project. Let's see what all the ways we have to fix these.
1. In code itself:
Add suppression line before your method, with warning type and justification, the syntax is below
[SuppressBPWarning(‘<BPWarningType>’, <Description/Justification>.)] for example [SuppressBPWarning(‘BPParameterNotUsed’, Parameter required by the event interface.)].
This is an example for the same.
2. Edit Best Practice Suppression file (AxIgnoreDiagnosticList)
Every model should have a BP suppression file named AxIgnoreDiagnosticList, for system models, you can find related BP suppression file at
K:\AosService\PackagesLocalDirectory\<ModelName>\<ModelName>\AxIgnoreDiagnosticList
Right-click on your project and select ‘Edit Best practice Suppression’. For all system models, this action will open the related BP suppression file.
For a new model:
In case you created a new model for your development (of course you would ) you have to create this file manually the first time, and on a later stage, you can amend for all BP fixes.
Create a new XML file under below path, I recommend to use a separate Visual studio instance for Create OR Edit this file.
K:\AosService\PackagesLocalDirectory\<yourModel>\<YourModel>\AxIgnoreDiagnosticList
Copy paste below
<?xml version="1.0" encoding="utf-8"?>
<IgnoreDiagnostics>
<Name>myModel_BPSuppressions</Name>
<Items>
<Diagnostic>
<DiagnosticType>BestPractices</DiagnosticType>
<Severity>Warning</Severity>
<Path>dynamics://<warning path></Path> //You can get this path from warning message
<Moniker>BPParameterNotUsed</Moniker> //You can get this from error message
<Justification>FormDataSourceEventArgs e is mandatory parameter for events and not used in the current context.</Justification>
</Diagnostic>
</Items>
</IgnoreDiagnostics>
Keep adding below tag for every warning
<Diagnostic>
<DiagnosticType>BestPractices</DiagnosticType>
<Severity>Warning</Severity>
<Path>dynamics://<warning path></Path> //You can get this path from warning message
<Moniker>BPParameterNotUsed</Moniker> //You can get this from error message
<Justification>FormDataSourceEventArgs e is mandatory parameter for events and not used in the current context.</Justification>
</Diagnostic>
</Items>
</IgnoreDiagnostics>
Some recommendations:
1. Best would be to create a new file using VS and place in the respective folder. Also, while adding new records best would be to edit this file from separate VS instance rather than same solution explorer.
2. You will find the BPWarningType in the warning message. If you not sure about the justification OR if you want to make consistency with system existing BP suppression, see the standard code.
3. I recommend using a separate Visual studio instance for Create OR Edit this file.
Cheers
Harry…
July 08, 2018
Import Data Packages through LCS
Hi Folks,
In my last post, we discussed how to create default data packages through the Asset library. LCS is really a good tool to manage your Dynamics project. Today we will discuss one more tool Configuration and Data manager.
Demo 1:
In the first demo, we will see how to import a single data package.
Step 1. Login in LCS. Select your project.
Step 2. Got to configuration and Data management tool. Below is the landing page
Step 4: Once you select a destination environment, now you have to select the company (legal entity) where you want to import this data package.
Select the company and hit the Apply button.
Step 5: Now you go back to your environment and navigate to Data management workspace. You can see a new project created under Data management to import this data package. You can also track the job from the same screen.
Demo 2:
The above demo applicable for single data package import. You can also select multiple data packages and import them in both Concurrently and sequentially. Let's see how…
Step 1: Select multiple data projects (all package must belong logically same module/group)
Step 2: Click on Apply button and select the first option – ‘Apply concurrently’. On next screen give a tag name.
Step 3: Repeat step 3 to 5 from Demo 1.
If you select the other option ‘Apply sequentially’, the immediate next screen will ask for a sequence of data packages,
However, the system will give you default sequence based on name and entity contained. You can update the sequence of each package manually as well.
Once you set the sequence, rest steps are the same as the previous import.
I personally found this tool really helpful when a developer really need some test/setup data while development and they can not go back and forth to get dummy data. If the functional team have data in templates/Packages simple you can apply them to any dev/test box.
Try it and share your feedback.
Cheers
Harry…
In my last post, we discussed how to create default data packages through the Asset library. LCS is really a good tool to manage your Dynamics project. Today we will discuss one more tool Configuration and Data manager.
Demo 1:
In the first demo, we will see how to import a single data package.
Step 1. Login in LCS. Select your project.
Step 2. Got to configuration and Data management tool. Below is the landing page
here 1. Menu tile, to perform operationsStep 3. Select a package from the grid ( section 2) and click on apply (section 1). The system will ask for destination environment,
2. Available list of data packages
3. Package details and version
4. List of entities in selected package (its blank here cause of my environment. )
Step 4: Once you select a destination environment, now you have to select the company (legal entity) where you want to import this data package.
Select the company and hit the Apply button.
Step 5: Now you go back to your environment and navigate to Data management workspace. You can see a new project created under Data management to import this data package. You can also track the job from the same screen.
Demo 2:
The above demo applicable for single data package import. You can also select multiple data packages and import them in both Concurrently and sequentially. Let's see how…
Step 1: Select multiple data projects (all package must belong logically same module/group)
Step 2: Click on Apply button and select the first option – ‘Apply concurrently’. On next screen give a tag name.
Step 3: Repeat step 3 to 5 from Demo 1.
If you select the other option ‘Apply sequentially’, the immediate next screen will ask for a sequence of data packages,
However, the system will give you default sequence based on name and entity contained. You can update the sequence of each package manually as well.
Once you set the sequence, rest steps are the same as the previous import.
I personally found this tool really helpful when a developer really need some test/setup data while development and they can not go back and forth to get dummy data. If the functional team have data in templates/Packages simple you can apply them to any dev/test box.
Try it and share your feedback.
Cheers
Harry…
June 30, 2018
How to create default Data packages Dynamics 365 FO
Hi Folks,
Now we all know how powerful and useful is LCS for Dynamics 365 projects. There are a lot of tools to manage your project efficiently and their powerful tool helps you to manage your project well. For any project Data management (import and export) is very essentials milestone for any environment and this can surely be a time consuming and lengthy if we are not using the right tools.
Well, LifeCycle service (LCS) provides a powerful tool to manage the data import and export for a project. Configuration and data manager tool (to import data package, will cover in next post) allows selecting multiple data packages and import in any environment for a project. In this article, I will show how to create default data package in LCS asset library. This tool will help you create the default template in a sequential manner.
(However, I planed a long back to write this article but…. I hope its never too late. )
Let's start…..
1. Login into https://lcs.dynamics.com/ using your organization credentials.
2. Select the project and go to Asset library > Process data Package; if you didn't see this tool icon on project landing page then try below
You can see we have only 2 files here.
3. Now to create default packages click on Import button and select a library from the list,
4. The above step will create a new record in process data package, it will create the data packages under ‘Data package’ tab in Asset library.
5. Once this process done you can go back to configuration and data manage toll you can see all the packages available here. You can download them, you can import them into any other environment. Also, you can download and fill out the data and upload them back on LCS to deploy these package on another environment.
Thanks all for the subjected topic, the below few details to explore further,
You can also update the Data packages (add new records, remove associate business process etc, ). To explore this go back to Asset library and click on your record and follow below steps.
In the next screen (Add data packages) you will see the list of all packages with sequencing number.
Also if you click on each package in above list in right window you will the details for the selected package.
Click on next> Next and complete this wizard. (for this post don’t select anything on 4th step ‘Associate business process to data package’)
Cheers
Harry
Now we all know how powerful and useful is LCS for Dynamics 365 projects. There are a lot of tools to manage your project efficiently and their powerful tool helps you to manage your project well. For any project Data management (import and export) is very essentials milestone for any environment and this can surely be a time consuming and lengthy if we are not using the right tools.
Well, LifeCycle service (LCS) provides a powerful tool to manage the data import and export for a project. Configuration and data manager tool (to import data package, will cover in next post) allows selecting multiple data packages and import in any environment for a project. In this article, I will show how to create default data package in LCS asset library. This tool will help you create the default template in a sequential manner.
(However, I planed a long back to write this article but…. I hope its never too late. )
Let's start…..
1. Login into https://lcs.dynamics.com/ using your organization credentials.
2. Select the project and go to Asset library > Process data Package; if you didn't see this tool icon on project landing page then try below
You can see we have only 2 files here.
3. Now to create default packages click on Import button and select a library from the list,
4. The above step will create a new record in process data package, it will create the data packages under ‘Data package’ tab in Asset library.
5. Once this process done you can go back to configuration and data manage toll you can see all the packages available here. You can download them, you can import them into any other environment. Also, you can download and fill out the data and upload them back on LCS to deploy these package on another environment.
Thanks all for the subjected topic, the below few details to explore further,
You can also update the Data packages (add new records, remove associate business process etc, ). To explore this go back to Asset library and click on your record and follow below steps.
In the next screen (Add data packages) you will see the list of all packages with sequencing number.
Also if you click on each package in above list in right window you will the details for the selected package.
Click on next> Next and complete this wizard. (for this post don’t select anything on 4th step ‘Associate business process to data package’)
Cheers
Harry
June 11, 2018
[Solved] display method 'salesPcsPrice' defined on 'InventTable', referenced in data source *****
Hi Folks,
During some RnD on On hand inventory form, I have to duplicate the InventOnHandListPage, and while compiling this new form I was getting below error (even without any changes)
1. display method 'salesPcsPrice' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'Price', which is not recognized. Are you missing a module reference?
2. display method 'inventUnitId' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'UnitOfMeasureSymbol', which is not recognized. Are you missing a module reference?
3. display method 'purchPcsPrice' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'Price', which is not recognized. Are you missing a module reference?
The best solution I found for this issue, is:
Go to the method which causes this error > Check the method return type> check the respective EDT >Chcek the package.
Now chcek you model parameters if the EDT model refering to system model as well. If this model is missing in reference, add it and update the model parameter.
After model parameter update, build your model and these errors must be fixed.
Enjoy.!!
Harry
During some RnD on On hand inventory form, I have to duplicate the InventOnHandListPage, and while compiling this new form I was getting below error (even without any changes)
1. display method 'salesPcsPrice' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'Price', which is not recognized. Are you missing a module reference?
2. display method 'inventUnitId' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'UnitOfMeasureSymbol', which is not recognized. Are you missing a module reference?
3. display method 'purchPcsPrice' defined on 'InventTable', referenced in data source 'InventTable_DS' of form '<FormName>', returns type 'Price', which is not recognized. Are you missing a module reference?
The best solution I found for this issue, is:
Go to the method which causes this error > Check the method return type> check the respective EDT >Chcek the package.
Now chcek you model parameters if the EDT model refering to system model as well. If this model is missing in reference, add it and update the model parameter.
After model parameter update, build your model and these errors must be fixed.
Enjoy.!!
Harry
June 08, 2018
Solution: Build error for new class in D365FO
Error: The model element was saved with unparsable source code and cannot be used. Please edit the element in Visual Studio to fix the errors: <ProjectName> (CUS) [<Modelname>] K:\AosService\PackagesLocalDirectory\bin\XppSource\<ModelName>\<ObjectName>.xpp
Possible reason: Sometimes when we rename the object name in code and manually rename the object from Solution Explorer, respective metadata still pointing to old names. Ideally, it should be another way around, rename the object in solution explorer and then just open the object it will automatically rename in class code.
Suggested Solution:
This issue doesn't fix even after DB synch and Model build. The only solution I can find for this issue is by deleting the object and create a new one. Yes, delete the object and create a new one with same code and name. This should fix this error.
Let me know if you found some other fix for the same.
Cheers
-Harry
Possible reason: Sometimes when we rename the object name in code and manually rename the object from Solution Explorer, respective metadata still pointing to old names. Ideally, it should be another way around, rename the object in solution explorer and then just open the object it will automatically rename in class code.
Suggested Solution:
This issue doesn't fix even after DB synch and Model build. The only solution I can find for this issue is by deleting the object and create a new one. Yes, delete the object and create a new one with same code and name. This should fix this error.
Let me know if you found some other fix for the same.
Cheers
-Harry
June 06, 2018
Every single eBook and video is available for just $10
Hi Folks,
Packtpub
are on sale, Every single eBook and video is
available for just $10
-Harry
Follow us on Facebook to keep in rhythm with us. @Facebook
May 16, 2018
How deploy a metadata or X++ hotfix [D365FO]
[Edited: Oct 16, 2018]
Hi Folks,
Here I’m going to share how to deploy a metadata or X++ hotfix using Visual Studio menu. Follow below steps to get this done. I strongly recommend using VSTS check in once hotfix deployed. Of course, you don't have RDP access other than DEV environment so this option should be for DEV servers only.
Let's start by getting into your dev machine (RDP access).
1. Open Visual studio as admin
2. GO to D365> addins
3. Next windows
Browse metadata hotfix file
The file must be unzipped from a folder.
4. Click on prepare button
You will get an info log for completion
5. Now close this dialog box and As a next step, you need to check-in all affected object in VSTS. Its a mandatory step in the process so in case anything goes wrong you will have the option to revert the hotfix changes.
if you missed this step and you need to revert the changes, the system may delete the object itself as these objects were never part of VSTS.
6. After this intermediate code check-in, repeat step 2 and 3 and this time click on apply directly.
Get Infolog once complete
7. Do application build with DB synch and test the hotfix. If the hotfix is working expected than you need to check-in the objects again.
8. Sometimes these changes don’t come in pending changes for VSTS. In that case, you may need to add manually in VSTS branch. Go to Source control > <VSTS branch> > Metadata folder> Right click and select “Add Items to folder”. Don’t create any folder manually, the system must create respective folders automatically when you add an item.
9. Now the same can be added in the next deployment package to get this hotfix to change in further environment (another dev box or UAT/SIT/QA).
[Updated on Oct 22, 2018]
Here is a link for further reference,
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/migration-upgrade/install-metadata-hotfix-package
Thanks, Guys, Enjoy….
Harry.
Hi Folks,
Here I’m going to share how to deploy a metadata or X++ hotfix using Visual Studio menu. Follow below steps to get this done. I strongly recommend using VSTS check in once hotfix deployed. Of course, you don't have RDP access other than DEV environment so this option should be for DEV servers only.
Let's start by getting into your dev machine (RDP access).
1. Open Visual studio as admin
2. GO to D365> addins
3. Next windows
Browse metadata hotfix file
The file must be unzipped from a folder.
4. Click on prepare button
You will get an info log for completion
5. Now close this dialog box and As a next step, you need to check-in all affected object in VSTS. Its a mandatory step in the process so in case anything goes wrong you will have the option to revert the hotfix changes.
if you missed this step and you need to revert the changes, the system may delete the object itself as these objects were never part of VSTS.
6. After this intermediate code check-in, repeat step 2 and 3 and this time click on apply directly.
Get Infolog once complete
7. Do application build with DB synch and test the hotfix. If the hotfix is working expected than you need to check-in the objects again.
8. Sometimes these changes don’t come in pending changes for VSTS. In that case, you may need to add manually in VSTS branch. Go to Source control > <VSTS branch> > Metadata folder> Right click and select “Add Items to folder”. Don’t create any folder manually, the system must create respective folders automatically when you add an item.
9. Now the same can be added in the next deployment package to get this hotfix to change in further environment (another dev box or UAT/SIT/QA).
[Updated on Oct 22, 2018]
Here is a link for further reference,
https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/migration-upgrade/install-metadata-hotfix-package
Thanks, Guys, Enjoy….
Harry.
April 27, 2018
Report a production outage through Lifecycle Services
Hi Folks,
As we all aware LCS is a mandate now for any D365FO project with a lot of new changes/update in place. Things are slightly different now for the PROD environment where you don't have any access to servers for PROD all PROD servers are maintained by directly Microsoft.
Here is an update and I believe its an awaited update from most of our customer. Now you can report an outage for production environment straight from LCS, check below post for details;
https://blogs.msdn.microsoft.com/lcs/2017/12/18/report-production-outage-through-lcs/
Enjoy...
-Harry
Follow us on Facebook to keep in rhythm with us. https://fb.com/theaxapta
As we all aware LCS is a mandate now for any D365FO project with a lot of new changes/update in place. Things are slightly different now for the PROD environment where you don't have any access to servers for PROD all PROD servers are maintained by directly Microsoft.
Here is an update and I believe its an awaited update from most of our customer. Now you can report an outage for production environment straight from LCS, check below post for details;
https://blogs.msdn.microsoft.com/lcs/2017/12/18/report-production-outage-through-lcs/
Enjoy...
-Harry
Follow us on Facebook to keep in rhythm with us. https://fb.com/theaxapta
April 21, 2018
Demo data module in Dynamics 365 FO
Hi Folks,
In this post let discuss about the Demo Data module in Dynamics 365 for finance and operations. Let's get started with this module, how to use it, steps and the final output.
Step 1: Open you Dynamics 365 For finance and operation application and Go to Demo data module.
Step 2: D365FO will open a new side form and ask for which process you want to create demo data, Choose all of them which you need for demo records/transactions.
Step 3: For our example lets select Demand forecasting and click OK
This process may take time depends on the volume of data
Step 4: Once this process will finish you will see the data in your Dynamics 365 for Finance and operations module.
Step 5: Now let's try to create some more demo data for another process, You can do this for all available option from the list. This time select Sales order processing and inquiry.
Step 6: Currently there are 0 records in USMF entity
Step 7: Lets run Demo data generation now
Step 8: Now you click on al sales order you will found many new records, refer below screenshot
Cheers!!
Harry
Subscribe to:
Posts (Atom)