Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Portal - to fetch/get Dynamics Global options sets through liquid

  • 1.  Portal - to fetch/get Dynamics Global options sets through liquid

    Posted 21 days ago
    Hi everyone,

    Can I fetch the global options sets through liquid objects from dynamics 365 portal?
    My requirement is to fetch few dynamics 365 global options set and display them on a customised web page using Liquid.
    I am not using entity or web form here.
    If someone can help?

    Kind regards,
    Naz

    ------------------------------
    Jimmy mcad

    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Portal - to fetch/get Dynamics Global options sets through liquid

    D365UG/CRMUG ALL STAR
    Posted 21 days ago
    Here is a Web Template example using Liquid that will load all the optionset values and display them on a page.  You can likely modify/filter this for your requirements.

    You will need to setup an Entity Permission record for the stringmap entity and link to Web role(s) or you will not see any results.

    I also am not sure how "supported" this is because MS is not keen on folks reading the stringmap table directly, but I did a quick test and it works.

    {% extends 'Layout 1 Column' %}
    {% block main %}

    <!-- FetchXML Liquid Tag -->
    {% fetchxml optionsets %}
      <fetch returntotalrecordcount="true">
        <entity name="stringmap">
        <attribute name="attributevalue" />
        <attribute name="displayorder" />
        <attribute name="versionnumber" />
        <attribute name="objecttypecodename" />
        <attribute name="attributename" />
        <attribute name="value" />
        <attribute name="objecttypecode" />
        <attribute name="langid" />
        <attribute name="organizationid" />
        <attribute name="stringmapid" />
        </entity>
      </fetch>
    {% endfetchxml %}

    <!-- Parse through results -->
    {% if optionsets.results.total_record_count > 0 %}
      {% for optionset in optionsets.results.entities %}
        {{optionset.value}}
      </br>
      {% endfor %}
    {% endif %}
    {% endblock %}

    Cheers,
    Nick

    ------------------------------
    Nick Doelman
    Microsoft MVP
    Power Platform/Dynamics 365 Specialist
    Nick Doelman Co.
    Ottawa ON
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role