Linking two tables on a new page

Hi There

I am very new to BC365 and looking for a bit of help, I have created a new page with a source table of Contacts. I have added specific fields from the Contacts table but I need the “No.” field from the Customer table.

Below is what I have so far, when I edit the page I do get a drop-down on that field that has all the Customer “No.” values but I need it to auto-populate and link with the CT “No.” field from the Contact table.

page 90200 "Sales-i Contact"
{
    ApplicationArea = All;
    Caption = 'Sales-i Contact';
    PageType = List;
    SourceTable = Contact;

    layout
    {
        area(Content)
        {
            repeater(General)
            {
                Caption = 'General';
                field("No Contact Business Relation"; Rec."No. of Business Relations")
                {
                }

                field("Company No"; CustomerNo."No.")
                {
                    TableRelation = Customer."No.";
                }

                field("No."; Rec."No.")
                {
                }

                field("First Name"; Rec."First Name")
                {
                }
                field("Middle Name"; Rec."Middle Name")
                {
                }
                field(Surname; Rec.Surname)
                {
                }
                field(Name; Rec.Name)
                {
                }
                field("Job Title"; Rec."Job Title")
                {
                }
                field("Phone No."; Rec."Phone No.")
                {
                }
                field("Fax No."; Rec."Fax No.")
                {
                }
                field("Mobile Phone No."; Rec."Mobile Phone No.")
                {
                }
                field("E-Mail"; Rec."E-Mail")
                {
                }
                field(Address; Rec.Address)
                {
                }
                field("Address 2"; Rec."Address 2")
                {
                }
                field(City; Rec.City)
                {
                }
                field(County; Rec.County)
                {
                }
                field("Post Code"; Rec."Post Code")
                {
                }
                field("Country/Region Code"; Rec."Country/Region Code")
                {
                }
            }
        }
    }
    var
        CustomerNo: Record Customer;

}

As I said I am very new to this and any help would be appreciated.

Thanks
Sean

Hi SeanT,

The problem with what you are trying to achieve is that Contacts do not link directly to Customers. Contacts, as a matter of fact, can be linked to Vendors and Bank Accounts as well.

For you to find IF there is a link between a Contact and a Customer, you would need to explore table “Contact Business Relations” and find a relation for Customers in there. If there’s one, you will then find the Customer No. for that Contact. If there’s no Contact Business Relations, then your Contact most likely relates to another Master Data entity, or it’s just a contact without any Business Relations.

This might be a little confusing, but I’d suggest you read more about the Contact Management system in BC and how Business Relations work between Contacts and other tables.

Rgds,