M Hussnain Javed
M Hussnain Javed

Reputation: 1

Implementing cascading in Business Central for custom tables

I have a query regarding implementing cascading for custom tables.

In D365 Business Central, when a user changes the Customer No. in the Customer Master, BC automatically propagates the updated customer number throughout the system.

I have a custom master table that I'm using in several custom tables. If I update the value of the primary key/field in the custom master table, I want BC to update its value wherever this field is being used. Is this possible using pure AL Language? If yes, how can I do that?

Upvotes: -1

Views: 112

Answers (1)

kaspermoerch
kaspermoerch

Reputation: 16560

The key property in this case is the TableRelation property:

field(50000; "Customer No."; Code[20])
{
    TableRelation = Customer."No.";
}

This field would be updated with the new value if the customer was renamed i.e. a new value was assigned to the No. field on a record in the Customer table.

One thing to note that even though this looks like a foreign key on SQL level it is not maintained as that. It is handled solely by the platform meaning that if you many fields on many records it can be a rather time consuming process for the platform to handle the update.

Upvotes: 1

Related Questions