Category: Validation Rule

Restrict Uploading Files In Salesforce

While working in Salesforce, we sometimes come up with the requirements where we need to build some sort of validation to restrict uploading files with specific extensions or in other words, allow only approved file types/extensions. This is very important because uploading executing or javascript code can bring potention security concerns by exposing internal data to outside world.

So allowing only certain type of files for upload is a very common requirement. In this blog post, I am sharing couple of solutions with pros and cons to implement this requirement.

Read More

How to check for Permission Sets in Validation Rule

Recently while dealing with one of the requirement for my current project, I need to check for logged in user’s persona and based on that, write validation rules which will restrict them to do some operations.Here is the requirementLet’s say we have two personas – Change User and Change Manager. Both Change User and Change Manager can view and edit the cases, but when the case is in “In Progress” state, Change User is not allowed to update the target resolution date on the case.SetupBoth the personas – Change User and Change Manager share the same role in the role hierarchy. (I know realistically they should have different role, but in my scenario, this is what customer wants as it aligns with their organization structure). So the way to differentiate them is through permission set. As a result, I have created two permission sets – Change User and Change Manager. Assigned the permission sets to respective users. “In Progress” is a case status value and Target resolution date is a custom field on Case object.Problem facedTo implement the requirement that “Change User is not allowed to update the target resolution date on the case when the case is in In Progress state”, I need to write validation rule. But there is no way that you can check for logged in user’s assigned permission set in validation rule. There is a...

Read More
Loading

Earlier Posts

  • 2024 (31)
  • 2023 (47)
  • 2022 (25)
  • 2021 (35)
  • 2020 (41)
  • 2019 (13)
  • 2018 (16)
  • 2017 (14)
  • 2016 (18)
  • 2015 (74)
  • 2014 (20)