Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Change the attritube : IsValidForAdvancedFind on entity - crm online

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

  • Verified answer
    Clem Profile Picture
    Clem 2,541 on at
    RE: Change the attritube : IsValidForAdvancedFind on entity - crm online

    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.

  • Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: Change the attritube : IsValidForAdvancedFind on entity - crm online

    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.

  • Clem Profile Picture
    Clem 2,541 on at
    RE: Change the attritube : IsValidForAdvancedFind on entity - crm online

    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
    Aileen Gusni 44,522 on at
    RE: Change the attritube : IsValidForAdvancedFind on entity - crm online

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans