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();
Form Patterns are introduced in Dynamics 365 for Finance and Operations, In Dynamics AX2012 we used form styles. These Patterns provide a base structure based on particular style (including required and optional controls), and also provide many default control properties. Patterns have made the form development very easier and after applying the pattern its validate and give the gurantee to the developers that its correct and consistant.
Patterns help validate form and control structures, and also use of control in some places.Form patterns provide many default control properties, and these also contribute to a more guided development experience.
List of Top Level Form Patterns
||What it’s used for
|Details Master (two variants)
||A form that displays the details of a complex entity
||A form that displays the details of a complex transaction entity and its lines (for example, and order and its lines)
|Dialog (six variants)
||A form that is used as a dialog to gather a set of information
|Drop Dialog (two variants)
||A form that is used as a drop dialog to gather a small set of information to provide context for an action
|FactBox (two variants)
||A Microsoft Dynamics AX 2012 FactBox that displays information about a related record or set of records
||A Dynamics AX 2012 List Page
|Lookup (three variants)
||A form that is used as a lookup
|Simple Details (four variants)
||A form that is focused on a single record
||A form that displays details for a simple entity as a grid that has fewer than 10 fields per record
|Simple List & Details (three variants)
||A form that displays information about an entity of medium complexity
|Table of Contents
||A form that displays setup information or loosely related information sets
|Task (two variants)
||A legacy form pattern that is used to display master or transaction entities
||A form that displays a set of tab pages to the user to gather information in a predetermined order
||A form that is used to display an overview of an activity and is meant to be a primary means of navigation
|Workspace Panorama Sections (three variants)
||A form that is used to show content for a panorama section (via a Form Part Control) in the Operational Workspace
This is just an introduction of the form patterns will describe each pattern in details in separate post.