DavidFeldhoff / al-codeactions

MIT License
17 stars 8 forks source link

[Suggestion] 'Generate SetLoadFields' ? #124

Closed fvet closed 3 years ago

fvet commented 3 years ago

Related topic: https://www.yammer.com/dynamicsnavdev/#/Threads/show?threadId=1033577983172608

I recently started using the AL Toolbox extension to fix locations where SetLoadFields could be applied. I'm mainly worried on our core / large tables that are valid candidates for table extensions (and thus resulting in many - redundant - table joins) and gradually wanted to apply SetLoadFields per each table, by searching Get / Find operations on these tables and evaluate if the context would support a SetLoadFields.

I'm not convinced yet on the impact and if we should need to pro-actively add SetLoadFields on every record find/get statement for simple read operations. (https://demiliani.com/2020/10/12/dynamics-365-business-central-new-features-for-performant-code/#comment-26605), so I'd focus on the most important tables first.

It's however very time-consuming to review / evaluate all code and start applying the SetLoadFields, pushing me towards a more scripted approach / (batch / fix me) code action. (not knowing if MS would provide improved platform support ...)

Idea would be to scan:

Search SetLoadFields candidates for:

Scan the code and apply SetLoadFields in simple / very specific cases only (can be gradually extended):

Does this sound:

fvet commented 3 years ago

Closed. We got rid of the idea of pro-actively applying SetLoadFields...

DavidFeldhoff commented 3 years ago

Oh okay. I just waited for the answer of al-toolbox as they already have this functionality in some kind, so I thought anyway that I wouldn't have to implement it. But good to hear it's solved for you