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 ?
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
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.
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
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.
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 ?
Hi Menna, You need to refresh Datasource after update, try calling ExecuteQuery method of datasource.
For reference, check this thread
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.
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.
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156