I'm posting to a general journal in ax 2012. I'm able to create the journal and enter most line information from x++ code. Now i'm having an issue with some vendor numbers.
When I use this code most of the time it works. But there are a few vendor numbers that are not able to be found from this table and of course throws an error. Weird thing is if I actually go into ax and type in the vendor number it does accept it because it has been setup in the system but by this code it is not working (for some).
Just wondering if there is something wrong with how the vendor number is setup, properly not linked with something, or if there is another way to properly set this parameter.
It looks like parmledgerDimension uses a RecId for vendors and only pulls it from DimensionAttributeValueCombination.
Any ideas?
DimensionAttributeValueCombination davc;
firstonly RecId from davc where davc.DisplayValue == account; //could be 010-000001
journalTrans.parmLedgerDimension(davc.RecId);
DimensionAttributeValueCombinationonly has a record for a dimension (in this case the vendor number) if the dimension has been used in a transaction. So check if the vendors for which this code fails have any transactions. - FH-InwayDimensionAttributeValueCombinationshould contain an entry for the vendor. I would suggest creating a purchase order for the vendor and do some postings with it. After each step, check ifDimensionAttributValueCombinationcontains a record for the vendor. After you have identified a process that creates such a record, you could debug it and find out how the record is created. Then you could extract the relevant code to create the record on your own without the process. - FH-Inway