AIF - Wrong field ID in the key data container in entity key
@SYS92355 = “Wrong field ID in the key data container in entity key”
This error message from the AIF in AX4sp2 did give me some headache today..
Finally I solved it. I was about to export a SalesOrder with both header and lines, but I did put my sendElectronically method in the SalesLine table, *not* in SalesTable table.. So when executed I never got the correct keys. The query I used for the axd wizard was based on SalesTable first, and THEN SalesLine..
Might help someone else with the same or similar problem!
October 12th, 2008 at 14:36
In AIF the following error is observed “Wrong field ID in the key data container in entity key” if the selected record is not found in the master table in order to send the data electronically.
A simple example would be as follows:
static void VendorOutbound(Args _args)
{
AxdVendTable axdVendTable;
AifEntityKey entityKey = new AifEntityKey();
AifPropertyBag aifPropertyBag;
VendTable vendTable;
XmlDocument xmlDocument = new XmlDocument();
;
select firstonly vendTable where vendTable.VendId == ‘0000083_SO’;
//Entity Key is a unique identifier. If the above select statement do not fetch any record from table then the discussed error would be thrown.
entityKey.parmKeyDataMap(SysDictTable::getKeyData(vendTable));
axdVendTable = AxdBase::newClassId(classnum(AxdVendTable));
xmlDocument.loadXml(axdVendTable.read(entityKey, null, new AifEndpointActionPolicyInfo(), new AifConstraintList(), aifPropertyBag));
xmlDocument.save(’c:\\VendTable_Out.xml’);
}
Would like to have your thoughts on the same
October 13th, 2008 at 07:44
I do alot of these projects. This time I had misplaced the send method. If the error message had been a bit more clear, I would have solved it a lot sooner.
/Henrik