Hi everyone,
I need to set a lookup value on Entity Form in CRM Portals. On Entity form I have a button which opens a form in modal where look is present but I am unable to set lookup value.
What I am doing is:-
1. From URL getting the id of the record
2. Running a fetchxml in liquid code
3. Inside {% if > 0 %} condition I am trying to set lookup's value like below using the value i have stored in variables.
{% fetchxml eventt %} <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false"> <entity name="new_event"> <attribute name="new_name" /> <attribute name="new_eventid" /> <order attribute="new_name" descending="false" /> <filter type="and"> <condition attribute="new_eventid" operator="eq" value="{{request.params['id']}}" /> </filter> </entity> </fetch> {% endfetchxml %} {% if eventt.results.entities.size > 0 %} {% assign eventID = eventt.results.entities[0].new_eventid %} {% assign eventName = eventt.results.entities[0].new_name %} <script> $(document).ready(function() { alert("before set "); $("#new_event_name").attr("value", "{{eventName }}"); $("#new_event").attr("value", "{{eventID}}"); $("#new_event_entityname").attr("value", "new_event"); alert("after set"); }); </script> {% endif %}
My Form inside Webform (It has 3 step):-
I was able to set the lookup value using similar code for another project but this isn't working.
Thanks in Advance.
*This post is locked for comments