Skip to main content
added 12 characters in body
Source Link

I need to figure out if values in PermissionSet for current user are changed in trigger, i'm thinking about using oldMap but i can't figure it out.

Maybe this code will explain what i'm trying to do:

    for (User u : trigger.New)
    {
        List<PermissionSetAssignment> isOldSetuplstOldPermSet = Trigger.oldMap.get(u.id).PermissionSetAssignments;
        List<PermissionSetAssignment> isNewSetuplstNewPermSet = // get PermissionSetAssignments via soql query

        if(isOldSetuplstOldPermSet != isNewSetuplstNewPermSet)
        {

// code goes in here

        }

    }

Any suggestions?

I need to figure out if values in PermissionSet for current user are changed in trigger, i'm thinking about using oldMap but i can't figure it out.

Maybe this code will explain what i'm trying to do:

    for (User u : trigger.New)
    {
        List<PermissionSetAssignment> isOldSetup = Trigger.oldMap.get(u.id).PermissionSetAssignments;
        List<PermissionSetAssignment> isNewSetup = // get PermissionSetAssignments via soql query

        if(isOldSetup != isNewSetup)
        {

// code goes in here

        }

    }

Any suggestions?

I need to figure out if values in PermissionSet for current user are changed in trigger, i'm thinking about using oldMap but i can't figure it out.

Maybe this code will explain what i'm trying to do:

    for (User u : trigger.New)
    {
        List<PermissionSetAssignment> lstOldPermSet = Trigger.oldMap.get(u.id).PermissionSetAssignments;
        List<PermissionSetAssignment> lstNewPermSet = // get PermissionSetAssignments via soql query

        if(lstOldPermSet != lstNewPermSet)
        {

// code goes in here

        }

    }

Any suggestions?

Source Link

How to get PermissionSet oldMap value and compare with new one in after update trigger

I need to figure out if values in PermissionSet for current user are changed in trigger, i'm thinking about using oldMap but i can't figure it out.

Maybe this code will explain what i'm trying to do:

    for (User u : trigger.New)
    {
        List<PermissionSetAssignment> isOldSetup = Trigger.oldMap.get(u.id).PermissionSetAssignments;
        List<PermissionSetAssignment> isNewSetup = // get PermissionSetAssignments via soql query

        if(isOldSetup != isNewSetup)
        {

// code goes in here

        }

    }

Any suggestions?