You need to sign in to do that
Don't have an account?

updating pricebook2id of an opportunity
Hi, I have an application where the user can choose between several pricebooks, add some products that get uploaded to SF.com. The first time the user does this, it works fine but if the go back to the begininning of the same record and change the pricebook it fails because the pricebook in SF.com is different. It deletes all the existing products but won't add the new ones. I need to be able to update the opportunity with the new pricebook2id. How can I do this? I'm using C#.
Thanks,
Rhonda
Thanks,
Rhonda
sForce.Opportunity oop = new sForce.Opportunity();
oop.Id = oppId;
oop.Pricebook2Id = sThisPBId;
sr = binding.update(new sForce.sObject[] {oop})[0];
3) Try to add the new line items (doesn't work);
How can I get this to work. If it is a new opportunity that doesn't have a pricebook already selected or has the correct pricebook selected, it works fine. It only fails if this is an old opportunity that uses one of the older pricebooks.
Thanks,
Rhonda