Skip to main content

Notifications

Announcements

No record found.

Business Central forum

Table relation issue in d365 bc cloud

(0) ShareShare
ReportReport
Posted on by 335

Hello all,

Please see below screenshot i am trying to add table relation In the batch name field  for form ( CutBack Batch)but in the Vs code table relation is not come

Please advise me how to to do this ?CutBack Batch form already published but in table relation is not come in VS code for CutBack Process form

tablerelationisnotcome.PNG

cutbackprocess.PNG

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    "{

    appId : “ ext 1 app I’d “,

    publisher: “ pub name from ext 1”,

    name: “ name from ext 1”,

    version: “ version from ext 1”,

    },"

    finally above the synatx is working now thank you very much ajay

  • Verified answer
    Ajay Kumar Jangiti Profile Picture
    Ajay Kumar Jangiti 130 on at
    RE: Table relation issue in d365 bc cloud

    According to the screenshot, you might b writing two different extensions here. Since you are writing two different extensions so you have to write a dependency of first extension on second extension by adding below details in app.jason under dependency:

    {

    appId : “ ext 1 app I’d “,

    publisher: “ pub name from ext 1”,

    name: “ name from ext 1”,

    version: “ version from ext 1”,

    },

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    Thank you Ajay Kumar Jangiti for help me and advise me

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    tblrela.PNG

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    Dear ajay ,

    Still am not getting table relation on respective field please find below my both table can you check there is have any issue

    CutBackProcessTable

    ***********************

    table 50106 CutBackProcessTable

    {

       DataClassification = ToBeClassified;

       fields

       {

           field(1; "Posting Date"; DateTime)

           {

               Caption = 'Posting Date';

               DataClassification = ToBeClassified;

           }

           field(2; "Account Category"; Code[20])

           {

               Caption = 'Account Category';

               DataClassification = ToBeClassified;

               TableRelation = "G/L Account Category";

           }

           field(3; "Bill Code"; Code[20])

           {

               Caption = 'Bill Code';

               DataClassification = ToBeClassified;

               TableRelation = "Dimension Value".Code;

           }

           field(4; "Partner"; Text[250])

           {

               Caption = 'Partner';

               DataClassification = ToBeClassified;

           }

           field(5; "License"; Text[200])

           {

               Caption = 'License';

               DataClassification = ToBeClassified;

           }

           field(6; "Percentage"; Option)

           {

               Caption = 'Percentage';

               OptionMembers = " ","Working Interest","Paying Interest","Revenue – Cost Oil","Revenue – Profit Oil";

           }

           field(7; "Account"; Text[20])

           {

               Caption = 'Account';

               DataClassification = ToBeClassified;

           }

           field(8; "Account Description"; Text[200])

           {

               Caption = 'Account Description';

               DataClassification = ToBeClassified;

           }

           field(9; "AFE"; Text[200])

           {

               Caption = 'AFE';

               DataClassification = ToBeClassified;

           }

           field(10; "Amount"; Integer)

           {

               Caption = 'Amount';

               DataClassification = ToBeClassified;

           }

           field(11; "Batch Name"; Text[250])

           {

               Caption = 'Batch Name';

               DataClassification = CustomerContent;

               TableRelation = CutBackBatchTable.Name" ;

           }

           field(12; "Posted"; Boolean)

           {

               width = 10;

               DataClassification = ToBeClassified;

           }

       }

       keys

       {

           key(PK; "Bill code")

           {

           }

       }

    }

    CutBackBatchTable

    ***********************

    table 50107 CutBackBatchTable

    {

       caption = 'CutBackBatchTable';

       DataClassification = ToBeClassified;

       fields

       {

           field(1; "Bill Code"; Code[20])

           {

               Caption = 'Bill Code';

               DataClassification = ToBeClassified;

               TableRelation = "Dimension Value".Code;

           }

           field(2; "Name"; Text[250])

           {

               Caption = 'Name';

               DataClassification = ToBeClassified;

           }

           field(3; "Description"; Text[250])

           {

               Caption = 'Description';

               DataClassification = ToBeClassified;

           }

           field(4; "Bill Code Description"; Text[250])

           {

               Caption = 'Bill Code Description';

               DataClassification = ToBeClassified;

           }

           field(5; "License"; Code[20])

           {

               Caption = 'License';

               DataClassification = ToBeClassified;

           }

           field(6; "License Description"; Text[250])

           {

               Caption = 'License Description';

               DataClassification = ToBeClassified;

           }

       }

       keys

       {

           key(PK; "Bill Code")

           {

               //Clustered = true;

           }

       }

    }

  • Verified answer
    Ajay Kumar Jangiti Profile Picture
    Ajay Kumar Jangiti 130 on at
    RE: Table relation issue in d365 bc cloud

    Hi

    Please check the table relation for the table

    table 50106 CutBackProcessTable

    {

       DataClassification = ToBeClassified;

       fields

       {

           field(1; "Posting Date"; DateTime)

           {

               Caption = 'Posting Date';

               DataClassification = ToBeClassified;

           }

           field(2; "Account Category"; Code[20])

           {

               Caption = 'Account Category';

               DataClassification = ToBeClassified;

               TableRelation = "G/L Account Category";

           }

           field(3; "Bill Code"; Code[20])

           {

               Caption = 'Bill Code';

               DataClassification = ToBeClassified;

               TableRelation = "Dimension Value".Code;

           }

           field(4; "Partner"; Text[250])

           {

               Caption = 'Partner';

               DataClassification = ToBeClassified;

           }

           field(5; "License"; Text[200])

              {

               Caption = 'License';

               DataClassification = ToBeClassified;

           }

           field(6; "Percentage"; Option)

           {

               Caption = 'Percentage';

               OptionMembers = " ","Working Interest","Paying Interest","Revenue – Cost Oil","Revenue – Profit Oil";

           }

           field(7; "Account"; Text[20])

           {

               Caption = 'Account';

               DataClassification = ToBeClassified;

           }

           field(8; "Account Description"; Text[200])

           {

               Caption = 'Account Description';

               DataClassification = ToBeClassified;

           }

           field(9; "AFE"; Text[200])

           {

               Caption = 'AFE';

               DataClassification = ToBeClassified;

           }

           field(10; "Amount"; Integer)

           {

               Caption = 'Amount';

               DataClassification = ToBeClassified;

           }

           field(11; "Batch Name"; Text[250])

           {

               Caption = 'Batch Name';

               DataClassification = CustomerContent;

               TableRelation = CutBackBatchTable.Name;

           }

           field(12; "Posted"; Boolean)

           {

               width = 10;

               DataClassification = ToBeClassified;

           }

       }

       keys

       {

           key(PK; "Bill code")

           {

           }

       }

    }

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    Hello Stefano Demiliani

    Could you Please share me vs code for both table(CutBackProcessTable ,CutBackBatchTable )tables you can see above screenshot accordingly i can understand otherwise i will be confuse

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Table relation issue in d365 bc cloud

    Set the TableRelation property on the field that must be related, so "Batch Name" in table 50106.

    So:

    field(1; "Batch Name"; code[50])

          {

              Caption = 'Batch Name';

              DataClassification = CustomerContent;

              TableRelation = CutBackbatchTable.Name   //If Name is the name to correlate, otherwise select the right field you need.

          }

  • SABIH Profile Picture
    SABIH 335 on at
    RE: Table relation issue in d365 bc cloud

    Hi Stefano Demiliani ,

    actually relation is not come (CutBackbatchTable.Name  ) on the respective field (Batch Name)

    Please check the below table

    table 50106 CutBackProcessTable

    {

       DataClassification = ToBeClassified;

       fields

       {

           field(1; "Batch Name"; code[50])

           {

               Caption = 'Batch Name';

               DataClassification = CustomerContent;

           }

           field(2; "Bill Code"; Code[20])

           {

               Caption = 'Bill Code';

               DataClassification = ToBeClassified;

               TableRelation = "Dimension Value".Code;

           }

           field(3; "Account Category"; Code[20])

           {

               Caption = 'Account Category';

               DataClassification = ToBeClassified;

               //TableRelation = "G/L Account Category";

           }

           field(4; "Posting Date"; DateTime)

           {

               Caption = 'Posting Date';

               DataClassification = ToBeClassified;

           }

           field(5; "Partner"; Text[250])

           {

               Caption = 'Partner';

               DataClassification = ToBeClassified;

           }

           field(6; "License"; Text[200])

           {

               Caption = 'License';

               DataClassification = ToBeClassified;

           }

           field(7; "Percentage"; Option)

           {

               Caption = 'Percentage';

               OptionMembers = " ","Working Interest","Paying Interest","Revenue – Cost Oil","Revenue – Profit Oil";

           }

           field(8; "Account"; Text[20])

           {

               Caption = 'Account';

               DataClassification = ToBeClassified;

           }

           field(9; "Account Description"; Text[200])

           {

               Caption = 'Account Description';

               DataClassification = ToBeClassified;

           }

           field(10; "AFE"; Text[200])

           {

               Caption = 'AFE';

               DataClassification = ToBeClassified;

           }

           field(11; "Amount"; code[20])

           {

               Caption = 'Amount';

               DataClassification = ToBeClassified;

           }

           field(12; "Posted"; Boolean)

           {

               width = 10;

               DataClassification = ToBeClassified;

           }

       }

       keys

       {

           key(PK; "Batch Name", "Bill Code")

           {

               //Clustered = true;

           }

       }

    }

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Table relation issue in d365 bc cloud

    Your second table is very malformed, but this is another story :)

    Your table relation in the "Batch Name" field should be TableRelation = CutBackbatchTable.Name

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans