?
Solved

dictTable.primaryKeyField() for InventTable returns null

Posted on 2009-12-29
6
Medium Priority
?
849 Views
Last Modified: 2012-05-08
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
Comment
Question by:tturney
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:quale-kaizen
ID: 26141991
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
 

Author Comment

by:tturney
ID: 26142081
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
 
LVL 7

Expert Comment

by:quale-kaizen
ID: 26142116
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:tturney
ID: 26142634
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
 
LVL 7

Accepted Solution

by:
quale-kaizen earned 2000 total points
ID: 26142797
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
 

Author Closing Comment

by:tturney
ID: 31670943
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

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question