locked
generic advanced find query based on current user? RRS feed

  • Question

  • Hello - Is there a way to create a generic advanced find query based on the current user?  For example, I can do an AF on Quotes where CreatedBy = "AMER\JoeUser".

    However, if I want the ability to create a generic AF query on Quotes that each user can generically use to see which quotes they have created then does CRM provide the ability to write a condition like CreatedBy = {CurrentUser}?

    Tuesday, July 2, 2013 9:52 PM

All replies

  • Just use the "Equals Current User" condition



    and this is the corresponding fetchxml

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
    <entity name="quote">
    <attribute name="name" />
    <attribute name="customerid" />
    <attribute name="statecode" />
    <attribute name="totalamount" />
    <attribute name="quoteid" />
    <attribute name="createdon" />
    <order attribute="name" descending="false" />
    <filter type="and">
    <condition attribute="createdby" operator="eq-userid" />
    </filter>
    </entity>
    </fetch>



    My blog: www.crmanswers.net


    • Edited by Guido PreiteMVP Tuesday, July 2, 2013 10:11 PM fixed
    • Proposed as answer by VidhiyaM Wednesday, July 3, 2013 5:32 AM
    Tuesday, July 2, 2013 10:10 PM