locked
Masking Values in Retrieve Multiple Not Working for Custom Fields CRM 2011 online RRS feed

  • Question

  • Hi ,

       Am trying to hide/mask field values through Retrievemultiple of Contact Entity through CRM2011 online

      The Below code is working for System fields condition like First name = "AAAAAA"etc. But when I give condition for custom field like custom_field = "AAAAAAA" it is not working, The form is not hiding the Values. Am using CRM 2011 online, Is that any reason for that ?.. Help me in resolving the issue.

     becViews = (EntityCollection)pluginContext.OutputParameters["BusinessEntityCollection"];
                        
                        foreach (Entity entity in becViews.Entities)
                        {
                            if (entity.Attributes.Contains("firstname") && (string)entity.Attributes["firstname"] == "AAAAAA") 
                            {     
                                entity.Attributes["mobilephone"] = "0";
                                entity.Attributes["firstname"] = "Restricted";
                            }
                        }

    Thanks

    T.Vinoth

    Friday, November 9, 2012 1:54 PM

Answers

  • Hi,

    the entities that are included in the "BusinessEntityCollection" will only inlcude attributes that are available in the view's columns. Which means, that they will only contain the attributes that are shown in the grid in Dynamics CRM.

    If you want to access more attributes you will either have to add your custom attribute to the corresponding view, or issue another "Retrieve" in the plugin for each retrieved entity with a Columnset that contains your custom attribute, in order to read the attribute.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Vinoth Thiru Friday, November 9, 2012 2:13 PM
    Friday, November 9, 2012 2:02 PM

All replies

  • Hi,

    the entities that are included in the "BusinessEntityCollection" will only inlcude attributes that are available in the view's columns. Which means, that they will only contain the attributes that are shown in the grid in Dynamics CRM.

    If you want to access more attributes you will either have to add your custom attribute to the corresponding view, or issue another "Retrieve" in the plugin for each retrieved entity with a Columnset that contains your custom attribute, in order to read the attribute.

    Greetings,

    Pavlos


    Please mark this reply as an answer and vote it as helpful if it helps you find a resolution to your problem.
    View my latest gallery contribution here.
    Visit my blog here.

    • Marked as answer by Vinoth Thiru Friday, November 9, 2012 2:13 PM
    Friday, November 9, 2012 2:02 PM
  • Hi Pavlos,

     Thanks for your answer. It help me to resolve the issue.

    Thanks

    T.Vinoth

    Friday, November 9, 2012 2:15 PM
  • Hi all, one more addition...

    You run this code in post event of the RetrieveMultiple Plugin so you have the BusinessEntityCollection. But you can also run a different version of this code in pre event modifying the query of the RetrieveMultiple...SO then you do not need to add this custom field to the view in order to be able to hide/change the related fields.

    Kind Regards.

    Mehmet Özgür Genç


    Mehmet Özgür Genç TradeSoft Business Services Vice President ozgurg@tradesoft.com.tr

    Friday, November 9, 2012 4:58 PM