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
pcave_jacksonriverpcave_jacksonriver 

Require account id when creating opportunity through the API

Is there a way to make account id required when creating an opportunity using the API? The interface makes it required but it's possible to create an opportunity via the API without an associated account.

 

Thanks.

Ankit AroraAnkit Arora

Have you tried creating a validation rule for it?

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

pcave_jacksonriverpcave_jacksonriver

I did, but that didn't work.

Deshraj KumawatDeshraj Kumawat

Hi,

 

validation rule works for me, make sure your validation rule is active.

 

If validation rule do not works for you, you can write a trigger on Opportunity object and validate Opportunities to have accountId and you can add error in trigger also.

 

Thank You !!