I have a custom record representing licenses/contracts a customer has purchased. Customers don't have any reason to see these records in the system, but their PARTNERS do. If I'm a Partner, I want to be able to see what my customers own, but I sure don't want other partners to see what my customers own. FYI - we use the Advanced Partner Center.
To the point, the custom record definition has options to Show Owner on Record and to Allow Change. If I enable these, I (as Administrator) can change the owner to any EMPLOYEE users, but not customer or partner users (I want to set it to the Partner). However, if I log in as a Partner and create such a record, the Owner field is set to the Partner and can save that way (this permits the Restrict Viewing and Editing permission to work exactly as I want). I (as Administrator) can't change it to another user, Save, then change it back to the Partner; it behaves similarly to the idea of inactivating an employee who is set in an employee field (e.g. on a Support case) in that it can stay the same and you can see them in the list, but cannot be changed and set back to that employee.
I tried scripting to set these values, both through nlapiSubmitField and by loading the record, setting the value, then submitting. Both times I get an "invalid reference key" error.
The native functionality in NS has essentially no controls available to keep users to their own records like it does with native records (e.g. lead/prospect/customer, transactions, etc). Because the Owner notion is broken, I resorted to preventing Partners from performing searches (permission "Perform Search" is not enabled), providing a list view to which they are restricted, and I built a "gatekeeper" script to ensure they can't load a record that doesn't belong to one of their customers.
If the Owner notion worked properly, I'd be golden, both in regards to searching and to record loading (viewing). I would simply set Owner to the current Partner of the customer. If the Perform Search permission set to View simply allowed a role to ONLY perform searches and not edit, I'd still be in heaven. Technically, setting Perform Search to View doesn't permit saving a search, but it might as well because they can set Criteria and Results as they choose, including removing the "Customer : Partner is Me" criteria.
I have a case opened on this: 1879319. I'd love to find out I and the rep are missing something simple. Maybe helping us figure out why the Apply Role Restrictions checkbox isn't available on the Customer or Partner fields on the custom record would solve this.