I have created application to post General Journal with default Dimension on AX system using service. But code not working and not posting any entry.
The Code that i have done for Default Dimension is as below.
AxdType_DimensionAttributeValueSet defaccount = new AxdType_DimensionAttributeValueSet();
AxdType_DimensionAttributeValue difdimValue1 = new AxdType_DimensionAttributeValue();
difdimValue1.Name = "Employees";
difdimValue1.Value = DefaultDimensionEmployees;
AxdType_DimensionAttributeValue difdimValue2 = new AxdType_DimensionAttributeValue();
difdimValue2.Name = "Location";
difdimValue2.Value = DefaultDimensionLocation;
defaccount.Values = new AxdType_DimensionAttributeValue[2] { difdimValue1, difdimValue2 };
//journalLine.DefaultDimension = defaccount;
journalLine.DefaultDimension = defaccount;
When i am trying to post this, 'i received Object reference not set to an instance of an object.'
Can anyone tell me what is wrong in above code?
Waiting for reply,
Momin