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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Data in Temp table doesn't update x++

(0) ShareShare
ReportReport
Posted on by 163

this is form with temp table , I have a validations in this form on close if Sum(allocation ratio) != 100 throw error . 

when I try to update allocation ratio to avoid error data doesn't update 

I try to add TempTable.update() ; on write () or on modified () but doesn't work well 

How can I fix it ?

1882.Screenshot-_2800_113_2900_.png

I have the same question (0)
  • Suggested answer
    GirishS Profile Picture
    27,833 Moderator on at

    Hi Menna,

    You need to validate the value on closed method of the form. Validate the allocation ratio if its greater then 100 update the table records otherwise throw warning.

    public boolean closed()
    {
        boolean ret;
        if(DataSourceName.AllocationRatio >= 100)
        {
            //update the table
        }
        else
        {
            throw warning("message");
        }
    }

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    238,846 Most Valuable Professional on at

    Menna, this is yet another thread of yours that I moved to another thread. Please don't put questions about F&O to Dynamics AX Forum.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Menna, You need to refresh Datasource after update, try calling ExecuteQuery method of datasource.

    For reference, check this thread

    www.dynamicsuser.net/.../2

  • Menna Allah Ahmed Profile Picture
    163 on at

    Hi Girish , I already do validation on can close () mehtod

    if (Sum(allocationRatio) != 100 )

    {

    throw error

    }

    else

    {

    // some logic

    }

    or you mean to add validation also on closed method ?

  • GirishS Profile Picture
    27,833 Moderator on at

    You can add your logic canClose method also. Where you want to update the allocation ratio? In the main form allocation grid?

    Have you debugged the code? Does the debugger hit?

    Thanks,

    Girish S.

  • Menna Allah Ahmed Profile Picture
    163 on at

    yes I want if I update data in main grid data update in form , what happened is when I update data in form and save it , it show me the last data not new data I entered

    I try to debug and it hit can close method , but problem appear when error throw doesn't make me to update data after that

  • Alex VN Profile Picture
    1,994 on at

    Hi Menna,

    This case I think we need to have more information. Possibly you can check as the data is saved in tmp table, hence everytime you open the form it will be a new temp table instance initiated. If you update the 'old' instance, I think it will not have effects so you need to revise the logic.

    Other case is that you might need to refesh the datasource if you can make sure you update the correct table buffer.

  • Menna Allah Ahmed Profile Picture
    163 on at

    Hi Alex ,

    what I want to do just when I change data in from update and remove error but what happened when I update data to remove error of allocation it didn't change and didn't remove error

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 470

#3
Adis Profile Picture

Adis 270 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans