Hello,
I'm on the latest version of Business Central. I extended the Purchase Invoice page. In the OnNewRecord trigger, I am trying to get the record before the blank new record is loaded. In the past in NAV, we used xRec to achieve this. Now, I get another record instead of the one on the page before clicking the new button. Has there been any changes with how xRec is used in Business Central? How do I capture a record that is displayed before pressing the new button on the page? In my case when there are two records No. 1 and 2, when record No. 1 is loaded on the page, and I click the new button to create a new invoice, xRec is No. 2 for some reason, I would expect it to be record No. 1? Any advice would be appreciated. Thanks.
Below is my code