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)


Report
All responses (
Answers (