web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How do I create and link an editable field to two tables using Events

(0) ShareShare
ReportReport
Posted on by 30
Hello,
I've created a table and a page for my field and I've extended the Customer table and Sales Header.
Basically, I want to create a new field in the customer table, card, and list. This field needs to appear also in the Sales Invoice under the customer's name.
The idea here is that if I change the field value in the Sales Invoice page, the value is automatically changed in Customer.
In order to achieve that, I need to use Events.
This is where it gets tough for me, the field needs to be editable so it can't be of class FlowField. However, the value cannot be fetched
from Customer if the field isn't Flowfield (through CalcForm).

I'm completely lost as to how to link the field and make it editable.
(Note: I'm using AL to write my code.)
How do I solve this issue?
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    92,077 Super User 2025 Season 2 on at
    RE: How do I create and link an editable field to two tables using Events

    Hi, a simple example, hope this will help. (This is not the only way)

    Add field:

    pastedimage1636678189621v1.png

    Add logic:

    pastedimage1636678208779v2.png

    Thanks.

    ZHU

  • Something Profile Picture
    30 on at
    RE: How do I create and link an editable field to two tables using Events

    Thank you for your help. My question is, do I use that example to get the user's input because otherwise, the value from my custom field list isn't showing on the customer card. It just remains empty

  • Suggested answer
    JAngle Profile Picture
    117 on at
    RE: How do I create and link an editable field to two tables using Events

    Example here with code snippets: docs.microsoft.com/.../devenv-events-example

    Event subscribers are triggered by the event itself. For example OnAfterValidate of a field. Once the standard table OnValidate code has run an event subscribers would be called

  • Something Profile Picture
    30 on at
    RE: How do I create and link an editable field to two tables using Events

    Hello. I appreciate your reply.

    Can you please elaborate on how would that look like in code? I'm new to development, and I'd appreciate an example. (For example, if I create an event subscriber where do I call it from?)

    Thank you!

  • Suggested answer
    Akshay_Panchal Profile Picture
    402 on at
    RE: How do I create and link an editable field to two tables using Events

    Hii,

    You can write your code under the OnafterValidateEvent of your customized field.

    Thanks.

    Verify, If this answer is helpful to you.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,878

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,405

#3
Sumit Singh Profile Picture

Sumit Singh 2,865

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans