static void defaultDimension(Args _args)
{
PurchLine purchLine;
DimensionAttributeValueSetStorage dimStorage;
int counter;
container attribute = ["BusinessUnit", "Department", "ItemGroup"];
DimensionAttribute dimensionAttribute;
DimensionAttributeValue dimensionAttributeValue;
;
purchLine = PurchLine::findRecId(35637329190);//sample to get default dimension
dimStorage = DimensionAttributeValueSetStorage::find(purchLine.DefaultDimension);
//all attribute
for (counter= 1 ; counter<= dimStorage.elements() ; counter++)
{
dimensionAttribute = DimensionAttribute::find(dimStorage.getAttributeByIndex(counter));
dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, dimStorage.getDisplayValueByDimensionAttribute(dimensionAttribute.RecId));
info(strFmt("%1 - %2", dimStorage.getDisplayValueByDimensionAttribute(dimensionAttribute.RecId), dimensionAttributeValue.getName()));
}
//specific attribute
for (counter= 1 ; counter<= conLen(attribute) ; counter++)
{
dimensionAttribute = DimensionAttribute::findByName(conPeek(attribute, counter));
dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, dimStorage.getDisplayValueByDimensionAttribute(dimensionAttribute.RecId));
info(strFmt("%1 - %2", dimStorage.getDisplayValueByDimensionAttribute(dimensionAttribute.RecId), dimensionAttributeValue.getName()));
}
}
2019-09-12
[AX2012] Get Default Dimension Value and Description
This is a job to show value and description of a default dimension.
2019-07-26
[AX 2009] Access Form Control by Code
This is a sample to change formstringcontrol label by code without autodeclaration. Control::GroupPayment_M_paymentDescription is a control id. The control id is formed from Control::+"Control Name".
public void run()
{
FormStringControl paymentDesc;
;
paymentDesc = element.control(Control::GroupPayment_M_paymentDescription);
paymentDesc.label("Payment description");
}
//AX2012
element.control(element.controlId(formControlStr(CustInvoice, GroupPayment_M_paymentDescription))).label("Payment description");
public void run()
{
FormStringControl paymentDesc;
;
paymentDesc = element.control(Control::GroupPayment_M_paymentDescription);
paymentDesc.label("Payment description");
}
//AX2012
element.control(element.controlId(formControlStr(CustInvoice, GroupPayment_M_paymentDescription))).label("Payment description");
Form control type
|
Class
|
ActiveX
|
FormActiveXControl
|
Animate
|
FormAnimateControl
|
Button
|
FormButtonControl
|
ButtonGroup
|
FormButtonGroupControl
|
CheckBox
|
FormCheckBoxControl
|
ComboBox
|
FormComboBoxControl
|
CommandButton
|
FormCommandButtonControl
|
DateEdit
|
FormDateControl
|
Grid
|
FormGridControl
|
Group
|
FormGroupControl
|
GuidEdit
|
FormGuidControl
|
HTML
|
FormHTMLControl
|
Int64Edit
|
FormInt64Control
|
IntEdit
|
FormIntControl
|
ListBox
|
FormListBoxControl
|
ListView
|
FormListControl
|
MenuItemButton
|
FormFunctionButtonControl
|
MenuButton
|
FormMenuButtonControl
|
Progress
|
FormProgressControl
|
RadioButton
|
FormRadioControl
|
RealEdit
|
FormRealControl
|
StaticText
|
FormStaticTextControl
|
StringEdit
|
FormStringControl
|
Tab
|
FormTabControl
|
TabPage
|
FormTabPageControl
|
Table
|
FormTableControl
|
TimeEdit
|
FormTimeControl
|
Tree
|
FormTreeControl
|
Window
|
FormWindowControl
|
Subscribe to:
Posts (Atom)