cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create Sales Quote through Opportunity by ABSL?

former_member273875
Participant
0 Kudos
256

Dear experts,

Currently, I create new Opportunity by using CreateWithReference function like this

var opportunity = this.BusinessTransactionDocumentReference.Opportunity.GetFirst();
if(opportunity.IsSet())
{
	var newOpportunity = Opportunity.CreateWithReference(opportunity)	
}

After that, I want to create new Sales Quote belong to newOpportunity with clone data from an exist Sales Quote. I tried to use

var newSalesQuote = CustomerQuote.CreateWithReference(currentSalesQuote);

The new SalesQuote is created with clone data from exist Sales Quote but I cannot assign OpportunityID to newSalesQuote because it throws read-only error.

How can I assign OpportunityID to newSalesQuote or how can I create new SalesQuote from an Opportunity with clone data from exist Sales Quote?

Thanks a lot for your support!

Regards,

Huy-Nguyen

View Entire Topic
former_member105365
Participant
0 Kudos

Hi Huy-Nguyen

Try and use an elementsof key word and build the structure of the Sales Quote (including the Opportunity ID) before you Create With Reference.

Cheers

Thomas