I am trying to close the page after using page.run or page.runModal but it does not wotk. This is the code:
I am trying to close the page after using page.run or page.runModal but it does not wotk. This is the code:
I solved this by using the CodeUnit ItemCostManagment
Thanks for your help, Yes, I created the same page, but the source table is not temp but still cannot figure out how to update the cost USD (my new field) I want to run it inside the Event subscriber (OnAfterInsertValueEntry in codeunit 22). I tried to run the new page, but it does not run until the Codeunit finish.
Emmm, I think you should change a solution.
I simply checked the source code of this page. Its operations are all for temporary tables. Even if you open and close the page, it will not affect the data outside the page.
Hope this helps.
Thanks.
ZHU
Thanks for your Answer, I tried it, but it did not work. The case here is I am calculating the average cost in USD and I want it to update every time the Unit cost updates. I think unit cost is calculated when this page ("Average Cost Calc. Overview") opens so I wrote the code in OnAfterGetRecord (same as BC code).
Can you try this way? This is just my thought, But you can think more. This worked for me.
Hi, I also tested it, unfortunately it doesn't work.
I also tried adding processing to trigger OnOpenPage(), but it still had no effect.
But the reverse is possible, for example, close the page first and then open the current page again.
https://yzhums.com/16756/
I feel like this is by design and may not be possible.
Hopefully other experts can give you better advice.
Thanks
ZHU
this is the Cost Average in Item Card I just want to execute the code in the OnOpenPage then close the page
Could you please explain what are you trying to do?
Generally we code like
if AvgCostCalcOverview.RunModal() = Action::LookupOK then
//Somelogic
You can check different Actions like OK, Cancel etc.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156