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
Resolver I
Resolver I

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
Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (4,008)