Personalized Community is here!
Quickly customize your community to find the content you seek.
Latest TechTalk Videos
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 2Check out the latest updates and new features of Dynamics 365 released from October 2022 through March 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
When selecting data from SQL in X++, you can provide a field list to limit the amount of data fetched from SQL. This improves the performance of the select statement; but risks that downstream consumers expects the data to be available, and might make wrong decisions.
select SalesId from salesLine;
This compiles perfectly, but will never write out anything, as salesLine.ItemId remains blank.
It is not possible for the compiler to detect these issues - as for example salesLine could be passed to another method.
Instead we have a runtime check.
Enabling the runtime checker can be quite useful before running unit tests to flush out any logical mistakes.!!!DO NOT DO THIS ON A PRODUCTION SYSTEM!!!
set Value = 1
where Name = 'CHECKINVALIDFIELDACCESS'
The SalesLine example above will throw an exception when the runtime checker is enabled.
The typical fix would be to add ItemId to the field list, or perhaps remove the field list all together. In some cases our logic is designed to handle non-selected fields (they have their null-value), here you can instruct the system to not perform the check.
You do that be adding this line:salesLine.checkInvalidFieldAccess(false);
THIS POST IS PROVIDED AS-IS; AND CONFERS NO RIGHTS.
Business Applications communities