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
Rafal Galazkiewicz 4Rafal Galazkiewicz 4 

Insufficient Privileges

I'm following work.com workbook but having it prinstalled from Salesforce 1 for admin guide so some parts need some modifications still. I have encountered this tricky issue.
Schema is such:
Warehouse (Master) - (detail) Merchandies (Master) - (detail) Line Item (detail) - (Master) Invoice

No roles in place yet

OWD:
Invoice  Private  
Line Item Controlled by Parent
Merchandise Controlled by Parent
Warehouse Public Read Only

Profile:
Merchandise Read
Warehouse Read

Permission set:
Invoices Read, Create, Edit, Delete
Line Items Read, Create, Edit, Delete
Merchandise Read
Warehouses Read

I can create Invoice record. Then on Line Item related list I click on New. Input webform opens. Invoice field is prefilled as open from related list and then I browse any Merchandise (owned by other user) and click save and I got this error:

"Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary."

Why is that? When I change OWD for Merchandise to Public Read/Write it lets me save Line Item record but why? Based on my definition order of relationship is such that primary is between Invoice and Line Item.

I'm lost a bit here ir it's so simple that I just don't see it.

Please help.
Best Answer chosen by Rafal Galazkiewicz 4
Rafal Galazkiewicz 4Rafal Galazkiewicz 4
OK. I can answer to myself, it always feels the best :)

Hint came from this article -
https://help.salesforce.com/HTViewHelpDoc?id=relationships_manytomany.htm&language=en_US

"Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines the sharing access that users must have to a master record in order to create, edit, or delete its associated detail records."

So I have changed that on Merchandise field master-detail
FROM
Read/Write: Allows users with at least Read/Write access to the Master record to create, edit, or delete related Detail records.
TO
Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records.

And it works!

All Answers

Rafal Galazkiewicz 4Rafal Galazkiewicz 4
I mean of course force.com workbook...
Rafal Galazkiewicz 4Rafal Galazkiewicz 4
OK. I can answer to myself, it always feels the best :)

Hint came from this article -
https://help.salesforce.com/HTViewHelpDoc?id=relationships_manytomany.htm&language=en_US

"Select a Sharing Setting option. For master-detail relationship fields, the Sharing Setting attribute determines the sharing access that users must have to a master record in order to create, edit, or delete its associated detail records."

So I have changed that on Merchandise field master-detail
FROM
Read/Write: Allows users with at least Read/Write access to the Master record to create, edit, or delete related Detail records.
TO
Read Only: Allows users with at least Read access to the Master record to create, edit, or delete related Detail records.

And it works!
This was selected as the best answer
Eduardo Dela RosaEduardo Dela Rosa
Thanks, Rafal. Your post is still useful - as it helped me figure out the exercise in Force.com workbook. I'm just surprised to learn that even the revised workbook hasn't been updated to include this what I should call a "miss-out" on the instructions.

Regards,
Ed
 
Rafal GalazkiewiczRafal Galazkiewicz
@Ed
That's great that you did benefit from my post. Happy I was able to help you.