@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!
Last 5 posts in Development
- No valid document identified from the entity key - April 9th, 2010
- Using Regular Expressions in Dynamics AX - October 2nd, 2009
- Create class and methods in x++ - December 22nd, 2008
- Simple field lookup in form - October 13th, 2008
- Get your Intercompany CustAccount - September 29th, 2008
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
That assumes that you have a clue on what’s wrong, which I didn’t … 🙂
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
I received this same error when I didn’t have an index set up on my table. The index happened to be the value I was sending in for my read, but I don’t know if that’s mandatory or not.