Hi All,
While creating purchline how to get attribute values from Excel document In Ax2012.Please suggest it.
Hi All,
While creating purchline how to get attribute values from Excel document In Ax2012.Please suggest it.
Hi,
You can read attribute values from excel and use below code to convert individual values to dimension set.
Public RecId retDefaultDimension(str _businessUnit = “”,
str _Department = “”,
str _costCenter = “”,
str _employee = “”)
{
Struct struct = new Struct();
container ledgerDimension;
DimensionDefault DimensionDefault;
int i ;
;
ledgerDimension = conNull();
if(_businessUnit)
struct.add(“BusinessUnit”, _businessUnit );
if(_Department)
struct.add(“Department”,_Department);
if(_costCenter)
struct.add(“CostCenter”,_costCenter);
if(_employee)
struct.add(“Employee”,_employee);
ledgerDimension += struct.fields();
for(i =1; i<=struct.fields();i++)
{
ledgerDimension += struct.fieldName(i);
ledgerDimension += struct.valueIndex(i);
}
DimensionDefault = AxdDimensionUtil::getDimensionAttributeValueSetId(ledgerDimension);
return DimensionDefault;
}
you can assign the returned recid to purchline.DefaultDimension field.
Thanks & Regards,
Britto John Baskar.A
Thanks Baskar.