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
OTOT 

Assertion Fails on OpportunityLineItem

I didn't see response to the other posting for the same problem so I'll try a fresh one..

I get the errror "Assertion Failed" when I attempt to insert a record in the OpportunityLineItem object

Any ideas?

RJ

 

Dim OppLineItem As New Sforce.OpportunityLineItem

OppLineItem.PricebookEntryId = "01u200000002rs7AAA"

OppLineItem.ProductId = "00j20000000jkGwAAI"

OppLineItem.Quantity = 1

OppLineItem.QuantitySpecified = True

OppLineItem.UnitPrice = 0

OppLineItem.UnitPriceSpecified = True

OppLineItem.Description = "Default Product created"

OppLineItem.OpportunityId = myReader("ObjectId").ToString

saveResults = sService.create(New Sforce.sObject() {OppLineItem})

If saveResults(0).success = False Then

Throw New Exception(saveResults(0).errors(0).message.ToString)

End If

DevAngelDevAngel
Don't set the product id.  That field is on the oppty line item for backward compatibility.