we have order and order product access community portal, we need to restrict orders to be visible with filtering it with certain fields and same for order products.

Order and order products are controlled by parent thats account.

Is it possible to achieve this requirement without writing custom solutions ? whats the best way to achieve this requirement


Because Order and Order Product are Controlled by Parent, you cannot use criteria-based sharing rules to grant visibility (the records are already visible if their parent Account is visible).

inherited sharing means your code inherits its sharing application mode (with sharing or without sharing) based on its calling context. It changes whether record-level visibility is applied to your query results at all; it has nothing to do with altering the actual visibility rules that are in place.

You'll have to either alter your org's entire sharing model for Orders, or build custom functionality.


Orders can have one the following Sharing models

  • Controlled By Parent
  • Private*
  • Public Read Only
  • Public Read/Write

If you use Controlled By Parent, and the profile grants access, all orders will get the access.

* When the Order Sharing mode is private, each order queue must have at least one member. If you are using order queues, please confirm in Orders setup that each queue has members

Remember that salesforce (for now and unless you are in the pilot of restrictive permissions) always works by opening permissions.

This means that you start by restricting as much as possible, and then opening it to the people / profiles / roles you want. (not having it opened and do something to close it / restrict it).

So I guess you could start by putting it in Private and start granting access from there.

Also keep in mind that Order Product's sharing setting can't be customised**, so without a custom solution you won't be able to control to which items they have access to.

If they have access to the Order, and access to the Order Products object (eg. read access), they'll have access to all order product records associated to the order

**(that I know of, but maybe by opening a ticket it is... I still remember the days when you had to open a ticket to get PriceBooks as No Access )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.