web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics Portals: Auto populate lookup field value if there is only one record in the lookup view after filtering.

(0) ShareShare
ReportReport
Posted on by

I got a scenario where I need to auto populate a lookup field value if there is only one record in the lookup view after filtering. 

For example: I used account lookup field where it shows only the accounts of logged in user, in the look up view. But if there is only 1 account in the lookup view i should rather auto populate the value than giving user the selection option.

Prior thanks,

Revanth.K 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Take a look at the following answer. It should help you with a resolution.

    community.dynamics.com/.../269771

    Hope this helps.

  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    Hi Revanth,

    The best way i can suggest you is:

    Perform a Odata Query onload of your form and Check how many accounts associated with logged in user/contact in CRM. If it is only one account then get it's name and guid and autopopulate/set in account lookup field.

    If you are conformtable with Liquid Template. You can use Fetch XML also instead of Odata Query in order to get associated Accounts of logged in portal user.

    So choice is yours. Can take help following articles for the same.

    For Odata Query:

    arpitmscrmhunt.blogspot.in/.../adxstudio-portal-how-to-use-odata.html

    For Fetch XML:

    arpitmscrmhunt.blogspot.in/.../how-to-use-fetch-xml-in-adxstudio.html

    For Setting value in Lookup:

    arpitmscrmhunt.blogspot.in/.../adxstudio-set-values-in-lookup-fields.html

    Mark the answer verified, If it helps.

    Cheers

    Arpit

    arpitmscrmhunt.blogspot.in

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans