SalesforceLabs / survey-force

85 stars 61 forks source link

Workaround for Set Audit Fields error #104

Closed dschach closed 3 years ago

dschach commented 3 years ago

Design in case anyone can work on it: When checking to make sure that LastModifiedDate has not been changed, do a check to see if PermissionsCreateAuditFields is a field on the Profile object. One could further query the current user's profile and pass the test if that permission is enabled. Alternatively (and better), the test should run as a newly-created user with a profile that does not have that permission enabled. First check if the field exists on Profile, and then query an existing profile where that is false, or just query any standard profile if the field is not on Profile.