web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Change the attritube : IsValidForAdvancedFind on entity - crm online

(0) ShareShare
ReportReport
Posted on by 2,541

Hello Everyone,

I know that to hide an entity from the advanced find drop down the regular process is to remove the read permission from the security role of the user.

Few days ago, i've read this article : http://blogs.webrange.com.au/index.php/2016/10/22/remove-entity-from-advanced-find-without-removing-users-access-via-security-role/ which match exactly what i need.

Problem is that via the SDK i was not able to do anything with this specific property which seems to be a Read Only one.

Does anyone have a solution here ?

Thanks a lot,

Clément

*This post is locked for comments

I have the same question (0)
  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Clement,

    As you use CRM Online, yes you cant update from DB.

    Honestly I haven't tried this but according to this article:

    msdn.microsoft.com/.../microsoft.xrm.sdk.metadata.entitymetadata.isvalidforadvancedfind.aspx

    "Gets or sets whether the entity is will be shown in Advanced Find."

    Which also the function:

    [DataMemberAttribute]

    public Nullable<bool> IsValidForAdvancedFind { get; internal set; }

    It has the 'set' method as well should be able to update, but I haven't tried it.

    You could try using this method to update the metadata..

    msdn.microsoft.com/.../gg509014.aspx

    UpdateEntityRequest updateBankAccountRequest = new UpdateEntityRequest

                       {

                           Entity = BankAccountEntity,

                           IsValidForAdvancedFind = true //or false here

                       };

                       _serviceProxy.Execute(updateBankAccountRequest);

    Hope this can help you.

    Thanks.

  • Clem Profile Picture
    2,541 on at

    Hello Aileen,

    Thanks a lot for your answer.

    I've tried the solution : 

    UpdateEntityRequest updateBankAccountRequest = new UpdateEntityRequest

                       {

                           Entity = BankAccountEntity,

                           IsValidForAdvancedFind = true //or false here

                       };

                       _serviceProxy.Execute(updateBankAccountRequest);

    But the property IsValidForAdvancedFind is not reachable from this point.

    I've tried to use reflection since the setter is an "internal" one like : 

    var property = entity.GetType().GetProperty("IsValidForAdvancedFind");
    property.SetValue(entity, false, null);

    But right now, i have no changes. In the article i mentioned in my first post, the guy is talking about clearing the server/client cache so maybe that's the reason.

    I will keep trying and keep you updated.

    Thanks,

    Clément

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Clement,

    You mean you cant find this "IsValidForAdvancedFind " as keyword intellisense like early bound variable in the C# Code?

    Hm, then try to use late bound then..

    Yes, you are right, it uses "internal" keyword.

    Ok, if it is successful, you can update it and it is something good information for others.

    Btw, is that possible you still show the entity but hide some important fields that you can set this property "Searchable" to None easily through the UI.

  • Verified answer
    Clem Profile Picture
    2,541 on at

    Well, sad news today.

    I just got the confirmation from MS that this property can't be updated via the SDK.

    We can indeed set the value with reflection on the object but during the EntityUpdateRequest, the system block the update of this specific property.

    So it's impossible to do it for Online instances.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans