how can i Mask sensitive data in sandbox

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I want to mask the account name of the account object. So that the user cannot view the Account name. How can i do this. please provide me some suggestion










share|improve this question







New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
    – Dave Humm
    1 hour ago










  • If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
    – Dave Humm
    1 hour ago
















up vote
1
down vote

favorite












I want to mask the account name of the account object. So that the user cannot view the Account name. How can i do this. please provide me some suggestion










share|improve this question







New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
    – Dave Humm
    1 hour ago










  • If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
    – Dave Humm
    1 hour ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to mask the account name of the account object. So that the user cannot view the Account name. How can i do this. please provide me some suggestion










share|improve this question







New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I want to mask the account name of the account object. So that the user cannot view the Account name. How can i do this. please provide me some suggestion







encryption






share|improve this question







New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Swathi

61




61




New contributor




Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Swathi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
    – Dave Humm
    1 hour ago










  • If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
    – Dave Humm
    1 hour ago
















  • Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
    – Dave Humm
    1 hour ago










  • If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
    – Dave Humm
    1 hour ago















Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
– Dave Humm
1 hour ago




Given that the account name is a mandatory field and is displayed by default on lookups this would be hard to do. What is the reason behind this as data visibility can be dealt with using Sharing and Roles?
– Dave Humm
1 hour ago












If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
– Dave Humm
1 hour ago




If this relates to making data in a sandbox different from Production, e.g. in a Full sandbox this can best be achieved with either a script run from the Developer Console or extracting the data scrambling any sensitive fields and reloading with Data Loader.
– Dave Humm
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
2
down vote













You can use SandboxPostCopy interface that allows you run an Apex class as soon as sandbox is refreshed. Use that class to run a batch class that makes your data encrypted.



I have implemented similar for my project you can refer that



public class SanboxRefreshAnononimyser implements Database.Batchable<sObject>,SandboxPostCopy 


public void runApexClass(SandboxContext context)

Database.executeBatch(new SanboxRefreshAnononimyser());





public Database.QueryLocator start(Database.BatchableContext BC)
String query='Select id,Name,PersonMobilePhone,PersonMobilePhone from Account';
return Database.getQueryLocator(query);


public void execute(Database.BatchableContext BC, List<Account> scope)

for(Account acc:scope)


acc.PersonEmail=acc.PersonEmail+'Dummy';


acc.PersonMobilePhone=acc.PersonMobilePhone+'Dummy';


acc.Phone=acc.Phone+'78';

acc.Name = SanboxRefreshAnononimyser.encryptText(acc.Name);





update scope;




public void finish(Database.BatchableContext BC)




private static String encryptText(String inputText)
String clearText = 'the quick brown fox jumps over the lazy dog';

Blob key = Blob.valueOf('123456789012345678901234');
Blob cipherText = Crypto.encryptWithManagedIV('AES192', key, Blob.valueOf(inputText));
String encodedCipherText = EncodingUtil.base64Encode(cipherText);
return encodedCipherText




Src: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm



That being said, if you have already refresh the sandbox, you can directly run this batch class in Apex to get it through.



 Database.executeBatch(new SanboxRefreshAnononimyser());





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "459"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Swathi is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f236849%2fhow-can-i-mask-sensitive-data-in-sandbox%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    You can use SandboxPostCopy interface that allows you run an Apex class as soon as sandbox is refreshed. Use that class to run a batch class that makes your data encrypted.



    I have implemented similar for my project you can refer that



    public class SanboxRefreshAnononimyser implements Database.Batchable<sObject>,SandboxPostCopy 


    public void runApexClass(SandboxContext context)

    Database.executeBatch(new SanboxRefreshAnononimyser());





    public Database.QueryLocator start(Database.BatchableContext BC)
    String query='Select id,Name,PersonMobilePhone,PersonMobilePhone from Account';
    return Database.getQueryLocator(query);


    public void execute(Database.BatchableContext BC, List<Account> scope)

    for(Account acc:scope)


    acc.PersonEmail=acc.PersonEmail+'Dummy';


    acc.PersonMobilePhone=acc.PersonMobilePhone+'Dummy';


    acc.Phone=acc.Phone+'78';

    acc.Name = SanboxRefreshAnononimyser.encryptText(acc.Name);





    update scope;




    public void finish(Database.BatchableContext BC)




    private static String encryptText(String inputText)
    String clearText = 'the quick brown fox jumps over the lazy dog';

    Blob key = Blob.valueOf('123456789012345678901234');
    Blob cipherText = Crypto.encryptWithManagedIV('AES192', key, Blob.valueOf(inputText));
    String encodedCipherText = EncodingUtil.base64Encode(cipherText);
    return encodedCipherText




    Src: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm



    That being said, if you have already refresh the sandbox, you can directly run this batch class in Apex to get it through.



     Database.executeBatch(new SanboxRefreshAnononimyser());





    share|improve this answer
























      up vote
      2
      down vote













      You can use SandboxPostCopy interface that allows you run an Apex class as soon as sandbox is refreshed. Use that class to run a batch class that makes your data encrypted.



      I have implemented similar for my project you can refer that



      public class SanboxRefreshAnononimyser implements Database.Batchable<sObject>,SandboxPostCopy 


      public void runApexClass(SandboxContext context)

      Database.executeBatch(new SanboxRefreshAnononimyser());





      public Database.QueryLocator start(Database.BatchableContext BC)
      String query='Select id,Name,PersonMobilePhone,PersonMobilePhone from Account';
      return Database.getQueryLocator(query);


      public void execute(Database.BatchableContext BC, List<Account> scope)

      for(Account acc:scope)


      acc.PersonEmail=acc.PersonEmail+'Dummy';


      acc.PersonMobilePhone=acc.PersonMobilePhone+'Dummy';


      acc.Phone=acc.Phone+'78';

      acc.Name = SanboxRefreshAnononimyser.encryptText(acc.Name);





      update scope;




      public void finish(Database.BatchableContext BC)




      private static String encryptText(String inputText)
      String clearText = 'the quick brown fox jumps over the lazy dog';

      Blob key = Blob.valueOf('123456789012345678901234');
      Blob cipherText = Crypto.encryptWithManagedIV('AES192', key, Blob.valueOf(inputText));
      String encodedCipherText = EncodingUtil.base64Encode(cipherText);
      return encodedCipherText




      Src: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm



      That being said, if you have already refresh the sandbox, you can directly run this batch class in Apex to get it through.



       Database.executeBatch(new SanboxRefreshAnononimyser());





      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        You can use SandboxPostCopy interface that allows you run an Apex class as soon as sandbox is refreshed. Use that class to run a batch class that makes your data encrypted.



        I have implemented similar for my project you can refer that



        public class SanboxRefreshAnononimyser implements Database.Batchable<sObject>,SandboxPostCopy 


        public void runApexClass(SandboxContext context)

        Database.executeBatch(new SanboxRefreshAnononimyser());





        public Database.QueryLocator start(Database.BatchableContext BC)
        String query='Select id,Name,PersonMobilePhone,PersonMobilePhone from Account';
        return Database.getQueryLocator(query);


        public void execute(Database.BatchableContext BC, List<Account> scope)

        for(Account acc:scope)


        acc.PersonEmail=acc.PersonEmail+'Dummy';


        acc.PersonMobilePhone=acc.PersonMobilePhone+'Dummy';


        acc.Phone=acc.Phone+'78';

        acc.Name = SanboxRefreshAnononimyser.encryptText(acc.Name);





        update scope;




        public void finish(Database.BatchableContext BC)




        private static String encryptText(String inputText)
        String clearText = 'the quick brown fox jumps over the lazy dog';

        Blob key = Blob.valueOf('123456789012345678901234');
        Blob cipherText = Crypto.encryptWithManagedIV('AES192', key, Blob.valueOf(inputText));
        String encodedCipherText = EncodingUtil.base64Encode(cipherText);
        return encodedCipherText




        Src: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm



        That being said, if you have already refresh the sandbox, you can directly run this batch class in Apex to get it through.



         Database.executeBatch(new SanboxRefreshAnononimyser());





        share|improve this answer












        You can use SandboxPostCopy interface that allows you run an Apex class as soon as sandbox is refreshed. Use that class to run a batch class that makes your data encrypted.



        I have implemented similar for my project you can refer that



        public class SanboxRefreshAnononimyser implements Database.Batchable<sObject>,SandboxPostCopy 


        public void runApexClass(SandboxContext context)

        Database.executeBatch(new SanboxRefreshAnononimyser());





        public Database.QueryLocator start(Database.BatchableContext BC)
        String query='Select id,Name,PersonMobilePhone,PersonMobilePhone from Account';
        return Database.getQueryLocator(query);


        public void execute(Database.BatchableContext BC, List<Account> scope)

        for(Account acc:scope)


        acc.PersonEmail=acc.PersonEmail+'Dummy';


        acc.PersonMobilePhone=acc.PersonMobilePhone+'Dummy';


        acc.Phone=acc.Phone+'78';

        acc.Name = SanboxRefreshAnononimyser.encryptText(acc.Name);





        update scope;




        public void finish(Database.BatchableContext BC)




        private static String encryptText(String inputText)
        String clearText = 'the quick brown fox jumps over the lazy dog';

        Blob key = Blob.valueOf('123456789012345678901234');
        Blob cipherText = Crypto.encryptWithManagedIV('AES192', key, Blob.valueOf(inputText));
        String encodedCipherText = EncodingUtil.base64Encode(cipherText);
        return encodedCipherText




        Src: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_System_SandboxPostCopy.htm



        That being said, if you have already refresh the sandbox, you can directly run this batch class in Apex to get it through.



         Database.executeBatch(new SanboxRefreshAnononimyser());






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 23 mins ago









        Pranay Jaiswal

        9,36431949




        9,36431949




















            Swathi is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Swathi is a new contributor. Be nice, and check out our Code of Conduct.












            Swathi is a new contributor. Be nice, and check out our Code of Conduct.











            Swathi is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f236849%2fhow-can-i-mask-sensitive-data-in-sandbox%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery