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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Joined data source not updating after changing key value

(2) ShareShare
ReportReport
Posted on by 15
Hello.
 
I have table XKOMTestTable with 1 field VendAccount. This table have relation with VendTable (XKOMTestTable.VendAccount == VendTable.AccountNum).
 
On form I have inner join with VendTable and with DirPartyTable to show readonly vendor name. It works but when I change account number name is not changed until i refresh page.
 
Is it possible to update name after changing account number?
 
 
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
    Joined data source not updating after changing key value
    Hi,
     
    You can use a display method to show the name of vendor.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Tomashu Profile Picture
    15 on at
    Joined data source not updating after changing key value
    I was using display method first but I need ability to sort/filter by vendor name.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,023 Super User 2025 Season 2 on at
    Joined data source not updating after changing key value
    Hi,
     
    Can you share the properties of DirPartyTable Datasource? Also did you try to refresh datasource on the modified method of VendAccount?
    What is the Relation Link with DirPartyTable DataSource?
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Tomashu Profile Picture
    15 on at
    Joined data source not updating after changing key value
    DirPartTable datasource looks like this:
     
    Using refresh/reread in modified/write doesn't help.
     
    [Form]
    public class XKOMTestTable extends FormRun
    {
        [DataSource]
        class XKOMTestTable
        {
            public void write()
            {
                super();
                
                XKOMTestTable_ds.reread();
                XKOMTestTable_ds.refresh();
                VendTable_ds.reread();
                VendTable_ds.refresh();
                DirPartyTable_ds.reread();
                DirPartyTable_ds.refresh();
                Info("write");
            }
    
            [DataField]
            class VendAccount 
            {
                public void modified()
                {
                    super();
    
                    XKOMTestTable_ds.refresh();
                    VendTable_ds.refresh();
                    DirPartyTable_ds.refresh();
                    Info("modified");
                }
    
            }
    
        }
    
        [DataSource]
        class VendTable
        {
            public void write()
            {
                
            }
    
            public boolean validateWrite()
            {
                return true;
            }
    
        }
    
        [DataSource]
        class DirPartyTable
        {
            public void write()
            {
                
            }
    
            public boolean validateWrite()
            {
                return true;
            }
    
        }
    
    }
     
    Table/form xml is here: https://pastebin.com/6CRM128T
    It was too long to include here.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,023 Super User 2025 Season 2 on at
    Joined data source not updating after changing key value
    Hi,
     
    Please try this code, but remove the code that you wrote on the write method.
     
     class VendAccount 
            {
                public void modified()
                {
                    super();
    
                    VendTable_ds.reread();
                    VendTable_ds.rereadreferencedatasource();
                    VendTable_ds.research(true);
               
                }
    
            }
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Joined data source not updating after changing key value
    Is it not changing even after saving the record?

    Only fetch active - keep this as default.
  • Suggested answer
    Waed Ayyad Profile Picture
    9,023 Super User 2025 Season 2 on at
    Joined data source not updating after changing key value
    Hi,
     
    Try to change the following property to No on DirPartyTable data source.
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Tomashu Profile Picture
    15 on at
    Joined data source not updating after changing key value
    Setting Only Fetch Active to No on both data sources don't change anything.
     
    Reread/research in VendAccount.modified don't do anything either. And I don't know why it should, it read data from database but at modified it's not changed yet.
     
    When I add 
    XKOMTestTable_ds.research(true);
    in XKOMTestTable.write it works. But it rereads while table when I know only 1 record is changed... :(
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Joined data source not updating after changing key value
    Can you show the table level relation properties with VendTable and the form level datasource properties?

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 683 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 563 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 398 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans