Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Data Item link AL

Posted on by 8
Hi 
I am trying to link Contact table with Contact Business Relation table, so I can find the related customer when filtered by contactNo. But I am getting an error "DataitemLink must be set" any ideas on this error please.
My code below
 
dataitem(Contact; "Contact")
        {
 
            column(ContactNo; "No.")
            {
            }



 
            dataitem(ContactBusinessRelations; "Contact Business Relation")
            {
                // Sets a link between FieldY of Table2 and FieldX of Table1.
                DataItemLink = "Contact No." = Contact "Company No.";
                //The dataset contains records from Table1 and Table2 where a match is found between FieldY and FieldX.
                SqlJoinType = InnerJoin;
 
                column(CustNo; "No.")
                {
 
                }
 
            }
 
            filter(Filter_ContactNo; "No.")
            {
 
            }
 
        }
Below is the error I am getting.
Categories:
  • Saurav.Dhyani Profile Picture
    Saurav.Dhyani 14,450 User Group Leader on at
    Data Item link AL
    Hi,
     
    SQL Joins are not allowed to be set on report object.
     
     
    Regards,
    Saurav Dhyani
  • YUN ZHU Profile Picture
    YUN ZHU 63,522 Super User on at
    Data Item link AL
    Hi, First of all, SqlJoinType cannot be used here.
     
     
    Second, there is something wrong with your writing. Please refer to Microsoft standard documents or objects.
    For example,
     
    Thanks.
    ZHU
     
     
  • gdrenteria Profile Picture
    gdrenteria 4,646 Super User on at
    Data Item link AL
    Hi
    Please review carefully how to use this report property.
    Sell-to Customer No.=FIELD(No.)
     
    BR
    GR

Helpful resources

Quick Links

First Dynamics 365 Community Call (CRM Edition)

Don't miss the first D365 Community Call on 7/10!

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 285,642 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,485 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans