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
Tanmay KansaraTanmay Kansara 

simplesalesforce enter products for opportunity

Hello All

New to using simplesalesforce Rest APi.For creating the opp, i know we can create an opportunity using the Salesforce.opportunity.create() call in Pyhton. 

If I need to create an opportunity with products, do i need to create an opp first and then reference the opp to create products ?

Appreciate your help on this. 

Thanks
Abdul KhatriAbdul Khatri
You need to tie the Opportunity and Product through OpportunityLineItem. 

As per you question yes you need to have an opportunity for later
Tanmay KansaraTanmay Kansara

THanks for the quick response. 

Just to clarify I need to do: sf.OpportunityLineItem.create(data)

For this data, can I pass multiple line items or do I need to pass them one at a time ?

Thanks

Abdul KhatriAbdul Khatri
I am not sure where the method is coming from. It all depends how that method is being developed.

Can you please provide some details about the method?
Tanmay KansaraTanmay Kansara
I am using the python simplesalesforce package. 

 
Abdul KhatriAbdul Khatri
You can find that in the documentation.

As per the design I think that is what unfornately going to work one by one. Please make sure it should not hit your Salesforce API Limit which you can check in Salesforce by 
  1. Goto Setup
  2. Under Quick Find write "System Overview"