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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

how to populate a field when another filed is modified on a page whose source table is temporary?

(0) ShareShare
ReportReport
Posted on by 607

Hi All,

I am quite new to Dynamics 365 BC.

I have created a custom page whose source table is temporary. i have managed to autopopulate few field when the page is opened, but for the rest i need to auto populate a specific filed say Y when a field X has been modified.

Can someone please explain how can i achieve this in detail?

Please help!

Thanks in Advance!

I have the same question (0)
  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hi AXBoy,

    Welcome to the other side if you came from AX, and I hope you like it over here :-). For pages based on Temp tables, I typically take a look at page 345 for inspiration. This used to be done with some code on OnFindRecord and OnNextRecord triggers, but nowadays we have the SourceTableTemporary page property to do it. So how to do it depends on what method you used. Below I made a small sample based on a temp Location table. When you run it, it will insert locations EAST and WEST. If you go into Edit mode and then change Name, then Name 2 will be updated.

    Is that the kind of thing you need to do?

    Best regards

    Lars

    == sample code ==

    OBJECT Page 99999 Temp Table Page
    {
    OBJECT-PROPERTIES
    {
    Date=30-01-20;
    Time=15:47:29;
    Modified=Yes;
    Version List=;
    }
    PROPERTIES
    {
    SourceTable=Table14;
    PageType=List;
    SourceTableTemporary=Yes;
    OnOpenPage=BEGIN
    Code := 'EAST';
    Name := 'East';
    INSERT;

    Code := 'WEST';
    Name := 'West';
    INSERT;
    END;

    }
    CONTROLS
    {
    { 1 ;0 ;Container ;
    ContainerType=ContentArea }

    { 2 ;1 ;Group ;
    Name=Group;
    GroupType=Repeater }

    { 3 ;2 ;Field ;
    SourceExpr=Code;
    ImplicitType=Code10 }

    { 4 ;2 ;Field ;
    SourceExpr=Name;
    OnValidate=BEGIN
    "Name 2" := Name + ' 2';
    END;

    ImplicitType=Text100 }

    { 5 ;2 ;Field ;
    SourceExpr="Name 2";
    ImplicitType=Text50 }

    }
    CODE
    {

    BEGIN
    END.
    }
    }

  • Verified answer
    keoma Profile Picture
    32,729 on at

    use trigger onvalidate of field X.

    in that trigger write: Y = <value>

  • AXBOY Profile Picture
    607 on at

    Thank you ,it worked.

    Like Franz said, On the page for that specified field(X) i have to use Trigger OnValidate and write the code.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans