tturney
asked on
dictTable.primaryKeyField() for InventTable returns null
Hello,
In out Axapta 3.0 environment, we frequently create InventTable items and then rename (change the itemId number) into a different sequence. Recently, the SysRecordInfo form won't allow use to rename and Item. When we trace into the code, the dictTable.PrimaryKeyField( ) functions returns null. We have ItemId setup as the primary key field and SQL shows that it is. What else could be causing this problem?
Tom T.
In out Axapta 3.0 environment, we frequently create InventTable items and then rename (change the itemId number) into a different sequence. Recently, the SysRecordInfo form won't allow use to rename and Item. When we trace into the code, the dictTable.PrimaryKeyField(
Tom T.
ASKER
The result of the job is 0. SQL still shows InventTable with a primary key of the ItemId field. In Axapta, InventTable also shows ItemId alone in the primary index. Any item I select to try and rename in the items table doesn't show that as an option. The CustTable still does allow renaming.
The problem is in the InventTable in AX.
Go to AX -> AOD -> Data dictionary -> InventTable -> Fields -> ItemId
and make sure the "Extendended Data Type" property is set to "ItemId".
Go to AX -> AOD -> Data dictionary -> InventTable -> Fields -> ItemId
and make sure the "Extendended Data Type" property is set to "ItemId".
ASKER
quale-kaizen,
Thanks for your replies. The ItemId field is still set to the extended data type of ItemId. I changed it, and then changed it back. I then resynced and compiled the table. Unfortunatly, the problem still exists.
Thanks for your replies. The ItemId field is still set to the extended data type of ItemId. I changed it, and then changed it back. I then resynced and compiled the table. Unfortunatly, the problem still exists.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
quale-kaizen,
It turned out it was a customization on the InventTable that was a relation to another table. Once I removed that, it worked fine. Thanks for your advice and help.
Tom T.
It turned out it was a customization on the InventTable that was a relation to another table. Once I removed that, it worked fine. Thanks for your advice and help.
Tom T.
2) Create new job in AX and run this code. What is the output? It should be an integer larger than 0.
Open in new window