function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
igs1964igs1964 

A Question about Creating Products using the API

How can I create a product via the API using the Create method, when the service returns a  required field is missing error (PricebookID)?  I haven't created the product yet so how can it have a Pricebook ID?  I also want to use an external ID field as the primary key, but this field is not part of the Product object when created, it is created in Product2?  Do I have to create the product directly in the Product2 object?  Any assistance on this would be appreciated
 
Cheers,
 
Ian
Rick.BanisterRick.Banister
Product and Pricebook have been replaced by Product2, PriceBook2, and PriceBookEntry. Add the Product2 and then the PriceBookEntry that links it to the PriceBook2.

Product2
=======
ID
NAME
PRODUCTCODE
DESCRIPTION
ISACTIVE
FAMILY

PriceBookEntry
===========
ID
NAME (name of the product)
PRICEBOOK2ID (id of pricebook2)
PRODUCT2ID (id of product2)
UNITPRICE
ISACTIVE
USESTANDARDPRICE
PRODUCTCODE

Enjoy.

igs1964igs1964
Thanks a ton...I thought it was something along these lines....I appreciate the help.