Forums

Forums / Developing Portals / Filtering in CRM Lookup Field Issue

Filtering in CRM Lookup Field Issue

Thread is closed for posting
2 posts, 1 answered
  1. pc
    pc avatar
    5 posts
    Registered:
    22 Oct 2015
    29 Oct 2015
    Link to this post
    I have a CRM lookup field looks like the xml code below, it is working great currently.
    I would like to add an additional condition, gm_expirydate >= today's date.

    I am not sure how to do it. Could someone please help?

    <fetch output-format="xml-platform" no-lock="true" version="1.0" mapping="logical">
    <entity name="gm_qsp">
    <attribute name="gm_vendor"/>
    <attribute name="gm_name"/>
    <attribute name="gm_qspid"/>
    <attribute name="gm_effectivedate"/>
    <attribute name="gm_expirydate"/>
    <attribute name="gm_program"/>
    <order descending="false" attribute="gm_vendor"/>
    <filter type="and">
    <condition value="BDE0BF26-176C-E411-80D6-00155D14C906" operator="eq" attribute="gm_program"/>
    </filter>
    <link-entity alias="" to="gm_vendor" from="new_vendorid" name="new_vendor">
    <filter type="and">
    <condition value="1" operator="eq" attribute="gm_approved"/>
    </filter>
    </link-entity>
    </entity>
    </fetch>

  2. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    Answered
    03 Nov 2015 in reply to pc
    Link to this post
    Hello PC,

    Here is a filter that you can add to your fetch that meets your criteria of gm_expirydate >= today's date.

    <filter type="or">
        <condition attribute="gm_expirydate" operator="next-x-years" value="999" />
        <condition attribute="gm_expirydate" operator="today" />
    </filter>
    
    Last modified on 03 Nov 2015 13:11 by Clinton Bale
2 posts, 1 answered