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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to do lookupReference and resolveReference via Chain of command?

(2) ShareShare
ReportReport
Posted on by 1,965
Hi,

I added an int64 "Category" field to "Table1" with Edt "EcoResCategoryId"
then i added this field to Form1

now i want to override the "lookupReference" and "resolveReference" methods of the field in the form datasource, in order to get the tree lookup.

but how to do it? 
When i first click on the drop down, it appears as normal lookup and everything appears without filtering the hierarchy role, then if i click on the drop down again, the tree lookup appears and it only shows the correct required data
 
[ExtensionOf(formDataFieldStr(Form1, Table1, Category))]
final class Form1FormDS_Extension
{
    public Common resolveReference(FormReferenceControl _formReferenceControl)
    {
        Common common;
        common = next resolveReference(_formReferenceControl);
        return EcoResCategory::resolveCategoryHierarchyRole(
                    _formReferenceControl,
                    EcoResCategoryNamedHierarchyRole::Retail);
    }

    public Common lookupReference(FormReferenceControl _formReferenceControl)
    {
        Common common;
        common = next lookupReference(_formReferenceControl);
        return EcoResCategory::lookupCategoryHierarchyRole(
                        _formReferenceControl,
                        EcoResCategoryNamedHierarchyRole::Retail);
    }
}
 
Categories:
I have the same question (0)
  • Suggested answer
    Waed Ayyad Profile Picture
    9,039 Super User 2025 Season 2 on at
    Hi.
     
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • .. Profile Picture
    1,965 on at
    My question was about CoC.
    The link you provided is not doing it via extensions.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans