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 :
Dynamics 365 Community / Blogs / Dynamics AX Concoction / AX2012:Restore or (Ctrl + F...

AX2012:Restore or (Ctrl + F5) command on forms using X++ code

Rachit Profile Picture Rachit 4,015 User Group Leader
Hi Friends,
This is a simple tip but good to keep the information handy.
When the records displayed on the form are updated by some other process we get an error "The values displayed in the form are not current, so an update or deletion cannot be made. To view the current values, on the Command menu, click Restore or press CTRL+F5".

In one of my recent projects, there was a situation when I wanted execute ctrl+ F5 command from code. I looked into the task macro but this command was not defined there so the challenge was to find the task id for this command so that I can pass it in element.task() method.

In order to get this task ID, I override the task method on the form and enabled debugger, opened the form and pressed ctrl + F5. The method was called and I got the task ID as 2839.

So in order to execute ctrl+F5 just call element.task(2839) and the record values will be restored.

You can also find task ID of other commands using this approach.

Thanks for reading the blog.
Keep sharing.

This was originally posted here.

Comments

*This post is locked for comments