cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cdamy
Helper II
Helper II

how could i prefill a basic form in insert mode

Hello,

I created a page which contains a basic form in insert mode. i need to prefill the fields on the form when it's loaded.

How could i do it?

Thanks.

Regards.

 

13 REPLIES 13
cdamy
Helper II
Helper II

@NatGeo , When talk about WebApi, it's related to xrm webservice call(REST).

So, if i understood. I just have to create a webtemplate and in this webtemplate i make liquid fetch query into this code i create script to populate my form. Lilke this:

{%assign opportunityid=request.params["id"]%}

{%fetchxml opportunities%}

<fetch>

<attribute...>

<filter>

<condition attribute="opportunityid"  operator="eq" value = "{{opportunityid}}"..>

 

</filter>

<endfetch>

{%endfetchxml%} 

{%for myopportunity in .......%}

<script>

//should i populate lookup here  like this??

$("#...").attr("value", {{myopportunity.contact.name}});

 

 

</script>

{%endfor%}

 

Thanks

NatGeo
Helper II
Helper II

Please  look at the link:

Custom Lookup filtering on PowerApps Portals - Dancing with CRM

It's great guide.

 

cdamy
Helper II
Helper II

Hello @NatGeo ,

I don't sure that i really understood, in this guide we have to change the render of the lookup and filter contents right? the things is that in my case i downloaded the custom form from specific table in dataverse. I need on loading to populate lookup fields of this basic form.

Anyway i will test and let you know.

Thanks.

Regards

 

cdamy
Helper II
Helper II

Hi @NatGeo, Thanks for your explanations. I tried with fetch but i encountered some issues, so now i tried to enabled odata feed functionality and i past through odata to retrieve needed fields and assign corresponding values to my lookups using jquery in custom javascript are of the basic form in additional setting tab. 

Now it works.

Thanks for all.

Regards

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Top Solution Authors
Users online (5,054)