Replies: 3 comments 1 reply
-
Yeah, I thought a lot about a rule like this recently. But it gets more complicated the longer you think about it. the rule should then also be able to trace variables if they are passed by reference, that only works until the call path leaves the current extension. |
Beta Was this translation helpful? Give feedback.
-
Also some other restrictions apply if the Findx would be followed by a Modify, ...: For performance reasons, it's not recommended to use partial records on a record that will do inserts, deletes, renames, field transfers, or copies to temporary records. All these operations require that all fields on the record are loaded, so the platform will emit a JIT load if they're not already loaded. |
Beta Was this translation helpful? Give feedback.
-
Maybe we should start 'small' first and limit the scope of the warning to below usages?
This would at least show the occurrences where a record is fetched to only read data / get a field value. https://www.yammer.com/dynamicsnavdev/#/Threads/show?threadId=1033577983172608 |
Beta Was this translation helpful? Give feedback.
-
Currently the CodeCop warns you if you use a field which is not loaded in the current scope, but this warning only occurs if you have SetLoadFields in your code scope - if you don't have it in the scope, the warning doesn't show up / it doesn't get checked
Hint: If you change SetLoadFields with AddLoadFields the warning also doesn't show up - so the trigger seems to be SetLoadFields for this CodeCop rule
The idea:
Example for 2.:
It doesn't give you the warning in the method :/
Reason:
To make the performance of your solution / app better by using <Set|Add>LoadFields this rule would be a big help.
Greets
someC0d3r :)
Beta Was this translation helpful? Give feedback.
All reactions