Logo
banner

Blogs

Show LOOKUP field as dropdown in PowerApp & update value in D365 Sales

, July 3, 2020 623 Views

Recently, I got a case where I need to show a lookup field as dropdown in Canvas App and update its value in D365 Sales. I have searched a lot over the internet but failed. In my opinion, there is no handy material available for this problem at internet. So, after lots of struggle I found a solution that I am going to share with you all through this blog. So that, it will make someone’s day.

 

In this blog we will have below sections:

  • Show lookup field as dropdown in Canvas App
  • Update selected value in lookup field of Dynamics 365 Sales entity

 

Let’s start with section 1

In D365 Sales, on the “Account” entity, there is a “Contact” lookup, the ‘Primary Contact’ field.

Now, let’s see how we can show that as a dropdown on the Canvas App.

  • Click on ‘Data Source’ icon and select ‘Dynamics 365’ from list of connectors

  • Click on ‘Add a connection’ for creating new connection with Dynamics 365.

  • After creating new connection choose required tables from the given list. In my case I have selected “Accounts” and “Contacts”. Then click ‘Connect’.

  • Now, design your app as per your requirement. From Contact lookup field insert a dropdown. Open it’s properties, set Items as Contacts and Value as Full Name. This will display all the contacts from the Contact entity in dropdown.

Here, we’re done with the first part.

Now, here comes another section, updating selected value into the lookup field of the Dynamics 365 Sales entity.

Add a button on your App. The OnSelect property of the button when you will patch the record, for the lookup field, you’ll see value, id and Type. Select the value part.

  • Write below code on OnSelect property of button

Patch(

Accounts,

{

'Account Name': ti_AccountName.Text,

'Primary Contact (_primarycontactid_value)': dd_PrimaryContact.Selected.Contact

}

);

That’s it. We’re done with the both the parts.

Above steps will successfully create an account and update Primary Contact lookup value into the Account entity.

I hope this will help you!!


ATM Inspection PowerApp to ease ATM inspection and report generation process.
https://powerapps.microsoft.com/en-us/partner-showcase/inkey-solutions-atm-inspection/

Insert data into Many-to-Many relationship in Dynamics CRM very easily & quickly, using the Drag and drop listbox.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/drag-and-drop-listbox

Comply your Lead, Contact, and User entities of D365 CRM with GDPR compliance using the GDPR add-on.
https://www.inkeysolutions.com/microsoft-dynamics-365/dynamicscrmaddons/gdpr

Create a personal / system view in Dynamics CRM with all the fields on the form/s which you select for a particular entity using the View Creator.
http://www.inkeysolutions.com/what-we-do/dynamicscrmaddons/view-creator

mm

Inkey

INKEY is your solution partner.
Our focus is to deliver you in-time intelligent innovative solutions ("key") for the problems in hand. Maintaining a quality standard right from the inception of a project is our top most priority.

Our team of talented professionals will execute your projects with dedication and excellence. We take ownership and accountability for the effort that goes into meeting our client’s needs.

Years of experience and proven success of delivering innovative custom solutions.

More posts by

Leave a Reply

Your email address will not be published. Required fields are marked *