Common Data Service allow you securely store and manage data that is used in the Business Applications.
Data within common data service is stored within set of records called entities. An entity is a set of records used to store data, similar to how a table store data within the database.
Entities – Common Data Service
Chain of Command now supports the more scenarios for the extensions on forms:
Now you can wrap the methods on forms, Forms data sources, Datafields and on form control methods.
- Form Data Sources
- Form Controls
- fields in data sources
Below is the complete example of Form Data source and just a code snippet for the rest. In below example we are updating the ratingmodel based on our custom logic that is global variable on the form.
Note: use element.FormToExtendVariable to access the form variables and datasources
Use element.FormToExtendMethod() to call the form methods
- [ExtensionOf(FormStr(FormName))] // for form extension
- [ExtensionOf(FormControlStr(FormName,FormControl))] // for form control method extension
- [ExtensionOf(FormDataFieldStr(FormName,FormDataSource,DataField))] // for form datasource method extension
- [ExtensionOf(FormDataSource(FormName,FormDataSource) // for form data source extension
Scenario: Sometimes developer needs table id of the table to use in their logic
Solution: you can get the table id for any table using sql query in the development environment.
SysTableIdView is the table from where you can fetch the Id.
Below is the query
select * from SysTableIDView
Scenario: Sometimes you need to extend the form init method in Dynamics 365 for Finance and Operations.
Below is sample code to extend:
/// <param name=”args”></param>
[PostHandlerFor(formStr(HcmRatingLevelIdLookUp), formMethodStr(HcmRatingLevelIdLookUp, init))]
public static void HcmRatingLevelIdLookUp_Post_init(XppPrePostArgs args)
FormRun fr = args.getThis();
//you have form run object to access the controls and datasources of form
Below are the list of features that added in the Application release 10.0.6 and platform update 30.
Scenario: Sometime during deployment users facing low space issue and deployment got failed.
Reason: The reason is deployable packages folder having many files that increase the drive used space. Microsoft by default deployable packages will delete after 30 days. If you deploy packages many times during the last 30 days. then you need to reduce the time of delete deployable packages
- Under the HKLM:\SOFTWARE\Microsoft\Dynamics\Deployment registry key, you can create the following keys to customize when cleanup should occur. The automated cleanup task will consider these values.
- CutoffDaysForCleanup – The number of days that old packages and logs should be retained. The default value is 30.
- CutoffDiskSpaceLimitForPackages – The minimum free disk space (in gigabytes [GB]) on the service volume drive where the package folder is located. For example, if the disk space is 200 GB, the cleanup task will remove the packages, based on the number of days.
- CutoffDiskSpaceLimitForLogs – The minimum free disk space (in GB) of the system drive where the log folder is located. For example, if the disk space is 100 GB, the cleanup task will remove the servicing-related logs, based on the number of days.
To get any form control on any form use below method. Create this method as static and use anywhere in your code.
Just need to provide FormRun and control name as parameters
Public Static FormControl getFormControl(FormRun _formRun, str _controlName)
FormControl control = _formRun.control(_formRun.controlId(_controlName));
Debug::assert(control != null);
Scenario: Sometime we need to use the form datasource field events to validate or modify the data.
In below code we are updating the data of one field based on modifying the data on the other field
/// <param name=”sender”></param>
/// <param name=”e”></param>
[FormDataFieldEventHandler(formDataFieldStr(HcmTopicCreate, HcmTopic, Title), FormDataFieldEventType::Modified)]
public static void Title_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
HcmTopic hcmTopic = sender.datasource().cursor();
HcmSkill hcmSkill = HcmSkill::findBySkill(hcmTopic.Title);
hcmTopic.Description = hcmSkill.Description;
Below are summary about the new update of Microsoft Dynamics Finance and Operations apps version 10.0.6
- Product Configuration models V2 data entity(2nd version)
- Feature Management Enhancements
- By default not all features are enable
- Project contract committed details
- Now user can drill-down into the details of the committed amount on the funding source
- Purchase agreement responsible party
- Now user can define primary and secondary responsible party on the purchase agreement classification form and resulting purchase agreement
- RFQ Link on the Purchase order line
- Now a reference link can be add from the purchase order line back to the corresponding RFQ lines they originated from
For more details visit Microsoft Documentation using below link
Whats changed in 10.0.6
Scenario: Sometime you have to use InMemory table buffer to apply some logic within the same buffer.
Solution: The solution is to use the sameTable variable by using SetTempData
// set the data to the local tmp table from the original tmp table
while select forupdate localTempTable //where localTempTable.somecoindtion ==
localTempTable.someField = ”;
//at the end after completing the loop set the tmp data back to the original tmp data
Scenario: Accessing of Microsoft Dynamics 365 for Finance and Operations database on sandbox environment.
In August 2019 Microsoft did the database scaling and migration in different regions. so might be your Dynamics 365 for Finance and Operations might be changed. When you trying to logon you will face some difficulty.
Below are the steps to access the new sql server and database.
- Copy the SQL server name from LCS and put on logon screen
- After adding above information click on options
- Copy the database name(below screenshot before AXDB) from the LCS environment and paste in the connect to database field as per above screenshot
- Click on connect and now you are successfully able to connect
Note: Please leave comments if you are facing any issue by following the above steps.
Scenario: Delete all record from table at once based on some condition.
//declare table varibale
// to delete all records with any condition
//delete records based on some condition
delete_from myTable where mytable.Recid = 12345677;
Unable to connect to the remote server at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)at Microsoft.WindowsAzure.Storage.Table.CloudTable.Exists(Boolean primaryOnly, TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists(TableRequestOptions requestOptions, OperationContext operationContext) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.PerformOperation(CloudStorageAccount storageAccount, String tableName, Func`1 operation) at Microsoft.DynamicsOnline.Infrastructure.Components.TableAccessor.TableStorageAccessor.AddRecord[T](CloudStorageAccount storageAccount, String tableName, T record) at
This issue is coming because Azure emulator is not running.
Issue can be checked and resolved using below commands.
Scenario: Normally next number sequence is created when new record create from the front end but sometimes we need to create next number sequence from code when importing the records thru code
Solution: Below code will be used to get next number sequence
NumberSeq::newGetNum(Number Sequence reference as parameter).num();
NumberSequenceReference _numberSequenceReference, mandatory
boolean _makeDecisionLater = false, optional
boolean _dontThrowOnMissingRefSetUp = false optional
,UnknownNoYes _allowManual = UnknownNoYes::Unknown optional
Scenario: Sometimes we need a simple dialog having some fields and we do not want to use dialog form ,instead of that we can create dialog thru X++ code.
Below is the code you can use to create simple dialog.
//Declare dialog variables
DialogField fieldfDate, fieldtDate;
FromDate _fromDate, _toDate;
dialog = new Dialog(“Select start and end date”);
//define fields to show on the dialog
fieldfDate = dialog.addField(extendedTypeStr(TransDate));
fieldtDate = dialog.addField(extendedTypeStr(TransDate));
//get values from the dialog fields
_fromDate = fieldfDate.value();
_toDate = fieldtDate.value();