web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

ItemKey does not currently exist in Item Master.

(0) ShareShare
ReportReport
Posted on by 390

Hello. 

I am getting this error:

A validation exception has occurred. Validation Errors: - ItemKey does not currently exist in Item Master.

For this code

                CompanyKey companyKey;

                Context context;

                ItemVendor itemVendor;

                ItemKey itemKey;

                VendorKey vendorKey;

                ItemVendorKey itemVendorKey;

                Policy itemVendorCreatePolicy;

                DynamicsGPClient wsDynamicsGP = new DynamicsGPClient();

                // Create a context with which to call the service

                context = new Context();

                companyKey = new CompanyKey();

                companyKey.Id = 7;

                // Set up the context object

                context.OrganizationKey = (OrganizationKey)companyKey;

                // Create an item vendor object

                itemVendor = new ItemVendor();

                // Create an item key to specify the item

                itemKey = new ItemKey();

                itemKey.Id = "randItemKey";

                // Create a vendor key to specify the vendor

                vendorKey = new VendorKey();

                vendorKey.Id = "VENCOMP7";

                // Create an item vendor key

                itemVendorKey = new ItemVendorKey();

                itemVendorKey.ItemKey = itemKey;

                itemVendorKey.VendorKey = vendorKey;

                // Populate the item vendor objects key property

                itemVendor.Key = itemVendorKey;

                // Get the create policy for item vendor

                itemVendorCreatePolicy = wsDynamicsGP.GetPolicyByOperation("CreateItemVendor", context);

                // Create te item vendor

                wsDynamicsGP.CreateItemVendor(itemVendor, context, itemVendorCreatePolicy);

 

The Vendor exist and i want to create a VendorItemNumber. What should i dot to get rid off with this error?

Thanks!

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    Re: ItemKey does not currently exist in Item Master.

    This error indicates the item is not current set-up in inventory, so it cannot be assigned.  Are you certain the item exits?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans