• Resolved danyelconstantin231

    (@danyelconstantin231)


    If i want to filter all the drop down from the contact entity. Basicly to have the some dropdown from crm in wordpress.

    What will be the code ?
    IS there a option or an parameter that i forget to put to view all the sistem views ?

    {% view entity=”contact” name=”Active Contacts” parameters=[ “contoso.com” ] lookups={ “parentcustomerid”: params.account } count=”10″ cache=”PT30M” %}{% endview %}

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author alexacrm

    (@alexacrm)

    @danyelconstantin231

    I’m not sure I understand what are you trying to do. Do you want a dropdown on a page that contains data from CRM? You can build one easily with twig code where you can use either view or fetchxml to retrieve the data. Then loop over the results and build your control.

    to view all the sistem views

    Again, I’m not sure what are you trying to build, the dropdown with the contacts or dropdown that contains the list of system views for the contact entity.

    HTH
    George

    Thread Starter danyelconstantin231

    (@danyelconstantin231)

    ’m not sure I understand what are you trying to do. Do you want a dropdown on a page that contains data from CRM? You can build one easily with twig code where you can use either view or fetchxml to retrieve the data. Then loop over the results and build your control.

    Can you give a simple exemple, a simple code ?

    Again, I’m not sure what are you trying to build, the dropdown with the contacts or dropdown that contains the list of system views for the contact entity.

    I want to show a dropdown that contains the list of system views for the contact entity.
    Can you give a simple exemple ?

    Plugin Author alexacrm

    (@alexacrm)

    Building dropdown from a view:

    [msdyncrm_twig]
    {% view entity="product" name="Web Product list" cache="PT2H" %}
    <select>
      {% for recordId, record in entityview.rows %}
         <option value="{{record['productid'].value}}">{{record['name'].value}}</option>
      {% endfor %}
    </select>
    {% endview %}
    [/msdyncrm_twig]

    Retrieving all system views for an entity can be done with fetchxml using savedquery entity:

    <fetch>
      <entity name="savedquery" >
        <attribute name="name" />
        <filter>
          <condition attribute="returnedtypecode" operator="eq" value="2" />
        </filter>
      </entity>
    </fetch>

    HTH
    George

    Thread Starter danyelconstantin231

    (@danyelconstantin231)

    This is for the products list but if i need to show all the system views from the entity “contact” in a drop down list will be like this:

    <fetch>
    <entity name=”contact” >
    <attribute name=”name” />
    <filter>
    <condition attribute=”returnedtypecode” operator=”eq” value=”2″ />
    </filter>
    </entity>
    </fetch>

    where “contact” is the entity ?

    and then to be in a drop down i have to put this:

    [msdyncrm_twig]
    {% view entity=”contact” name=”contact” cache=”PT2H” %}
    <select>
    {% for recordId, record in entityview.rows %}
    <option value=”{{record[‘productid’].value}}”>{{record[‘name’].value}}</option>
    {% endfor %}
    </select>
    {% endview %}
    [/msdyncrm_twig]

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[NSFW] Filter entity’ is closed to new replies.