• Ivano Guerini 6
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 1
    Replies

Security.stripInaccessible() will remove all ids of non-reparentable M-D fields from the record while using System.AccessType.UPSERTABLE. 

That will inevitably result in failures for records which are about to be inserted during the upsert as required m-d realtionship id values were removed. 

That makes stripInaccessible fn useless to enfore FLS before commiting to the database if there are any M-D fields involved.

I understand why its happening, but M-D Ids shoud not be removed in this case. And If there are any changed M-D parents for already existing records in dataset, system will prevent it the standard way. 

Security.stripInaccessible()  is a great and easy replacement for previous implementations, but with this flaw it does not cover all the usecases.



  

Security.stripInaccessible() will remove all ids of non-reparentable M-D fields from the record while using System.AccessType.UPSERTABLE. 

That will inevitably result in failures for records which are about to be inserted during the upsert as required m-d realtionship id values were removed. 

That makes stripInaccessible fn useless to enfore FLS before commiting to the database if there are any M-D fields involved.

I understand why its happening, but M-D Ids shoud not be removed in this case. And If there are any changed M-D parents for already existing records in dataset, system will prevent it the standard way. 

Security.stripInaccessible()  is a great and easy replacement for previous implementations, but with this flaw it does not cover all the usecases.