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
Mike -Mike - 

Create Opportunity with Quote through REST API

Hello everyone,

I want to create Opportunity with Quote through REST API, but I met the problem.

I create Opportunity through REST API and I can see it in SalesForce UI. After that I successfully create Quote with following parameters:
{
   "Name" : "NewTest",
   "OpportunityId" : "<OpportunityId>"
}
I can get this Quote through REST API, but I can't see it on UI neither assigned nor not assigned to Opportunity.

Also if I create Quote in SalesForce UI I can't find it in REST API even with direct request:
https://<domain>.salesforce.com/services/data/v39.0/sobjects/Quote/<Quote_ID>

Why the Quotes created through the REST API are not presented in the UI?
Why can not the Quotes created from UI be found from REST API?
How I can create Opportunity with Quote through REST API and see them in SalesForce UI?
Best Answer chosen by Mike -
Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello Mike,

What you're reporting is an odd behavior because if you create a Quote via REST API it should be available in Aloha/LEX and vice-versa.

The only thing that comes to my mind is that you have a visibility problems. Here are some thoughts that might be helpful:

- Quote by Standard has its Sharing Settings (OWD) set to Controlled by Parent, which means that its visibility depends of the Owner of the Opportunity.

- If the OWD of Opportunity is set to Private, it means that only an Administrator, the owner of an Opportunity, someone that holds a higher position in the Roles, or trough other sharing configurations of Salesforce will be able to see/edit the record.

- Unless you have View All permission over the object Opportunity and Quote in your Profile, by default, you won't be able to read the Quote unless you have other sharing configuration that grants you access.

- The reason you might not being able to see the record you are creating through the REST API is either because you load the data with a different user you're to access the UI/LEX/Aloha or because your List Views in the Quote object has a filter that is restrincting Quotes visibility. 

- Have you tried to take the Id of the record created through REST API and access directly in the Browser? In the classic view/aloha would be: yoursalesforcedomain.com/<RecordIdCreatedWithRest>

Record and Object visibility in Salesforce depends on many factors and is an extensive and important subject. 

Please let me know if you managed to solve your problem and if you want I can send you some links regarding sharing in Salesforce.

Hope to have helped!

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.


 

All Answers

Zuinglio Lopes Ribeiro JúniorZuinglio Lopes Ribeiro Júnior
Hello Mike,

What you're reporting is an odd behavior because if you create a Quote via REST API it should be available in Aloha/LEX and vice-versa.

The only thing that comes to my mind is that you have a visibility problems. Here are some thoughts that might be helpful:

- Quote by Standard has its Sharing Settings (OWD) set to Controlled by Parent, which means that its visibility depends of the Owner of the Opportunity.

- If the OWD of Opportunity is set to Private, it means that only an Administrator, the owner of an Opportunity, someone that holds a higher position in the Roles, or trough other sharing configurations of Salesforce will be able to see/edit the record.

- Unless you have View All permission over the object Opportunity and Quote in your Profile, by default, you won't be able to read the Quote unless you have other sharing configuration that grants you access.

- The reason you might not being able to see the record you are creating through the REST API is either because you load the data with a different user you're to access the UI/LEX/Aloha or because your List Views in the Quote object has a filter that is restrincting Quotes visibility. 

- Have you tried to take the Id of the record created through REST API and access directly in the Browser? In the classic view/aloha would be: yoursalesforcedomain.com/<RecordIdCreatedWithRest>

Record and Object visibility in Salesforce depends on many factors and is an extensive and important subject. 

Please let me know if you managed to solve your problem and if you want I can send you some links regarding sharing in Salesforce.

Hope to have helped!

Regards.

Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.


 
This was selected as the best answer
Mike -Mike -
Hello Zuinglio,

Thank you for very detailed answer.

After some investigation, I have noticed that our system contains 2 Quotes native and custom. It was the root of problem.

I belive that your commentary will be very usefull in future for us.
Jijo John 10Jijo John 10
Can we create a quote using https://<domain>.salesforce.com/services/data/v39.0/sobjects/Quote ? When i tried, it says  "The requested resource does not exist"
Nickey KumariNickey Kumari
did anyone knows the rest api for Quote "creat standard object"