• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 871
  • Last Modified:

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.
0
tturney
Asked:
tturney
  • 3
  • 3
1 Solution
 
quale-kaizenCommented:
1) Is this behavior  consistent for all items?

2) Create new job in AX and run this code. What is the output? It should be an integer larger than 0.
static void Job1(Args _args)
{
    SysDictTable dictTable = new SysDictTable(tableNum(InventTable));
    ;
    info(int2str(dictTable.primaryKeyField()));
}

Open in new window

0
 
tturneyAuthor Commented:
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.
0
 
quale-kaizenCommented:
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".
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
tturneyAuthor Commented:
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.
0
 
quale-kaizenCommented:
1) Is the inventTable modified? Can you delete all the customization in the InventTable (preferably in test environment)?

2) Can you go to InventTable -> Indexes -> ItemIdIdx and verify that the "Allow duplicates" property is set to "No"

3) Go to AOT -> Data dictionary -> Extended data types -> ItemId -> Relations and verify that the following relation exists: ItemId = InventTable.ItemId

4) If everything else fails you can still try to:
  - synchronize the entire data dictionary
  - rebuild all indexes (from Axapta)
  - recompile the entire application

Warning: before making any changes to the table properties, fields or indexes in AX please make sure you have backup of your data.
0
 
tturneyAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now