• Resolved yogiz

    (@yogiz)


    Hi,

    I managed to successfully install and connect to my instance.

    I am now trying to show a view from my PowerApps in a blog post on WordPress as a test. I have inclided a ICDS twig block and just copied and pasted your view example in the doc.

    {% view entity=”contact” name=”Active Contacts” %}{% endview %}

    Here when viewing the preview I get following error:

    Failed to render the template. Please contact the site administrator. Unknown “view” tag in “template_0ee961df524855883e03ddd691f9e7adf03b9aeb” at line 3.

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

    (@alexacrm)

    Hi @yogiz

    For now we pulled out views and forms functionality from the base plugin as we’re still working on the implementation and deployment details. I am aware that the documentation is yet to catch up, sorry about that.

    Having said that, the only thing that views do for you is the retrieval of the metadata at runtime. You can easily do it yourself using either direct record access or FetchXML. (And you can pull fetchxml from the view definition yourself if you want to make it truly dynamic)

    Thanks
    George

    Thread Starter yogiz

    (@yogiz)

    Hi George,

    Thanks for your answer.

    I have actually tried the workaround using FetchXML and this works fine as long as there are no lookup fields inside the display section.

    I use the display source code example in your documentation just with my own entities.
    eg: <li>{{record["name"]}}</li>

    This works fine but when I try to display a lookup
    <li>{{customer["accountid"]}}</li>

    I cannot even save the page as I receive an Invalid JSON error.

    What am I doing wrong here?

    Plugin Author alexacrm

    (@alexacrm)

    Hi @yogiz

    can you send through the complete twig code you’re using?

    Thanks
    George

    Thread Starter yogiz

    (@yogiz)

    Sure:

    {% fetchxml collection="offers" %}
       <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
        <entity name="fsm_offer">
        <attribute name="fsm_offerid" />
        <attribute name="fsm_name" />
        <attribute name="fsm_account" />
        <order attribute="fsm_name" descending="false" />
        <filter type="and">
          <condition attribute="statecode" operator="eq" value="0" />
        </filter>
      </entity>
    </fetch>
    {% endfetchxml %}
    
    <ul>
    {% for offer in offers.results.entities %}
      <li>{{offer["fsm_account"]}}</li>
    {% endfor %}
    </ul>

    fsm_account is a lookup to the Account entity

    when I use
    <li>{{offer["fsm_name"]}}</li>
    it works no problem

    Thread Starter yogiz

    (@yogiz)

    Hi George,

    Any advice on how to resolve the above?

    Much appreciated.

    Regards,
    Jurgen

    Plugin Author alexacrm

    (@alexacrm)

    Jurgen,

    account is a lookup and the display name will be Name property of the lookup (entity reference). That should work: <li>{{offer["accountlookupattributename"].Name}}</li> or even <li>{{offer.accountlookupattributename.Name}}</li>

    (not sure from your sample code what your lookup attribute name is, looks like fsm_account but I’m not sure)

    HTH
    George

    • This reply was modified 5 years, 6 months ago by alexacrm.
    Thread Starter yogiz

    (@yogiz)

    That did the trick!

    Thanks for your help.

    Thread Starter yogiz

    (@yogiz)

    Hi George,

    Any idea when views and forms will be available?

    I know in the meantime we can use Custom Forms, I am just wondering how I would populate a lookup (entityreference) since it is compromised of 3 parts (entityname, logicalname and GUID)

    Looking at the D365 Plugin I could define a default. I have tried
    {% form entity="fsm_offertocustomer" mode="create" default="fsm_offerid": { "LogicalName": "fsm_offer", "Id": "68EA116A-C304-EB11-A813-000D3A4A1F88", "DisplayName": "Free Beer" } %}

    But this is not working. The record is being created but the lookup field fsm_offerid is empty.

    Plugin Author alexacrm

    (@alexacrm)

    Hi @yogiz

    views and forms will become part of the premium and we’re currently in the beta stage. You can always retrieve the definitions and build those in twig yourself.

    {% form %} tag works with the custom layout and in that layout you’ll have a field (hidden or visible) that maps to fsm_offerid. Just set it explicitly in the layout.

    HTH
    George

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Unknown “view” tag in “template_”’ is closed to new replies.