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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Field related to two tables

(0) ShareShare
ReportReport
Posted on by 796

Hello, 

I have a table with an int64 (no EDT) field, I want this field related to either the ERModelMappingTable or the ERFormatMappingTable (depending on an enum value). 

pastedimage1678959063608v1.png

In the form I have a reference group:

pastedimage1678959281682v3.png

public Common lookupReference()
        {
            if(XYZ_ERTable.Direction == XYZ_Direction::Export)
            {                
                return ERFormatMappingTable::lookup(this, CustVendOutPaymConstants::modelName, CustVendOutPaymConstants::creditTransferContainerDescriptorName);
            }
            else
            {
                return ERModelMappingTable::lookup(this, classStr(ERTableDestination)   '#'   tableStr(XYZ_XYZ_HeaderTableEntity));
            }
        }

So the lookup filtering works great, but when selecting an ERFormatMapping (The second relation) I get the error: 

pastedimage1678959559476v4.png

So what I'm looking for a polymorphic lookup, also the field to show a descriptive text and not a RecId (already does that but I'm not sure how). 

  • André Arnaud de Calavon Profile Picture
    307,097 Super User 2026 Season 2 on at

    Hi Arcadi,

    You mentioned that the relation would depend on an enum value, but you haven't added the enum to the relations. You only used it to distinct the lookup. Ensure you will add the enum with the correct condition in the table relations for your two referenced tables.

  • Arcadi Profile Picture
    796 on at

    You are right André my relation was wrong and now works at a table level (With RecIds). But I'm getting the same error in the form. I think the reason is that I need to select a reference field in the reference group, So I have to choose between the fields of the format table or the fields of the model.

    pastedimage1679042484681v1.png

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 366

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 360 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans
Liquid error: parsing "/forums/thread/details/?threadid=%27nvOpzp;%20AND%201=1%20OR%20(%3C%27%22%3EiKO))," - Too many )'s.