Saturday, November 30, 2019
Wednesday, November 27, 2019
Enum extensions case in D365
Added two new values to an enum in the same model but in two different extensions.
The first one is looped perfectly (see code snippet below), and nothing but an index for the second. However, its value is present in a combobox.
Already built and synchronized the whole world. What else can it be?
Take a look from the SQL side.
There are some old values that I created before but deleted later. All of them are still there.
I had to delete these non-synced values manually from SQL, then added needed values in AOT, and synched DB.
In fact, DB sync is triggered if you have some changes in tables/views only.
Now it is correctly recreated.
BTW there are two good articles about the subject
1) Extensible enums: Breaking change for .NET libraries that you need to be aware of
2) Development tutorial: Extensible base enumerations in Microsoft Dynamics AX 7
The first one is looped perfectly (see code snippet below), and nothing but an index for the second. However, its value is present in a combobox.
[ExtensionOf(formStr(SysPolicyParameters))] final public class mySysPolicyParametersForm_Extension { public void populateTree() { DictEnum policyRuleTypeEnum; int i; policyRuleTypeEnum = new DictEnum(enumNum(SysPolicyRuleTypeEnum)); for(i = 0; i < policyRuleTypeEnum.values(); i++) { str sym = policyRuleTypeEnum.value2Symbol(i); info(strFmt("%1 %2 %3", i, policyRuleTypeEnum.value2Name(i), sym)); } next populateTree(); } }
Take a look from the SQL side.
There are some old values that I created before but deleted later. All of them are still there.
I had to delete these non-synced values manually from SQL, then added needed values in AOT, and synched DB.
In fact, DB sync is triggered if you have some changes in tables/views only.
Now it is correctly recreated.
BTW there are two good articles about the subject
1) Extensible enums: Breaking change for .NET libraries that you need to be aware of
2) Development tutorial: Extensible base enumerations in Microsoft Dynamics AX 7
Wednesday, November 20, 2019
Operating with system defined buttons in form Action pane
Say, we have to reference Edit button.
For this we use the macro #define.SystemDefinedViewEditButton('SystemDefinedViewEditButton')
The whole list is present in SysSystemDefinedButtons macro
Code snippet for your active method in name_DS
Check this article https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/system-defined-buttons
For this we use the macro #define.SystemDefinedViewEditButton('SystemDefinedViewEditButton')
The whole list is present in SysSystemDefinedButtons macro
Code snippet for your active method in name_DS
int active() { #SysSystemDefinedButtons ret = super(); < ... > FormCommandButtonControl editButton = element.control(element.controlId(#SystemDefinedViewEditButton)) as FormCommandButtonControl; editButton.enabled(name_ds.allowEdit()); return ret; }
Check this article https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/system-defined-buttons
Labels:
actionpane,
button,
D365,
edit,
form,
FormDataSource,
macro
Friday, November 15, 2019
Thursday, November 14, 2019
Subscribe to:
Posts (Atom)