Skip to main content

Hello experts,

 

We need to prevent dispatchers from manually dragging a SA from one ServiceTerritory to another different ServiceTerritory, but we found out that Scheduling Policies and Rule Violations are not really avoiding it but only warning, is there any way to prevent the users from doing this?

 

If this cannot be acomplished, is there any way to colour-code these SA with the Match Territory rule violation in red?

 

Thank you!

1 comment
  1. Oct 29, 2020, 10:16 PM
    Hey @Andrea Martínez Fernández

    I believe you could accomplish through a Trigger (initiated with a Assigned Resource Record being updated) using prior value on the Service Resource, querying their Service Territory Member record, grab the territory Id, and compare to the same for the new resource.

    However, I also believe you could accomplish with a 2 part declarative automation.

    First would be a before save flow (again that initiates off an AR Update) that does the same as the trigger above. Grabs the previous value of the Service Resource, Fetches the STM, Grabs the Territory, and compares to the New Resource's Territory.

    If Different it checks a custom checkbox field on the AR record (as before save flows can't update other records)

    That checkbox being updated then kicks off a second automation(after save flow) to grab the SA off the Assigned Resource, and then update the Gantt Color Field with a specific Hex Value so you can clearly see where those instances have occured.

    I tested the first part on my side (before save flow) and it worked (

    https://unofficialsf.com/how-to-use-ischanged-and-priorvalue-in-before-save-flows-by-gorav-seth/

    )

    Depending on your data volumes I might recommend the trigger route as that is better for scalability, but if volumes are not a concern I definitely feel like this can be achieved through declarative automation.

    There would be some considerations for sure like do you clear out the checkbox on the AR record after the SA update, so that it can be rechecked if it happens again. And there may be a way to initiate it off of the SA update as well, but would need to dig deeper.

    Hope that helps!

0/9000