sonar-openedge
sonar-openedge copied to clipboard
Missing field in query with fields
Hello,
It could be a good idea to detect this error :
FOR EACH Customer FIELDS (CustNum) WHERE Customer.CustNum < 10 NO-LOCK:
/* Customer.Name is missing from FIELDS */
MESSAGE Customer.CustNum SKIP Customer.Name VIEW-AS ALERT-BOX INFORMATION BUTTONS OK IN WINDOW CURRENT-WINDOW.
END.
Yes, interesting !
@clement-brodu Just wanted to add a note that if this is a problem you run into in a prod environment I'd suggest enabling the Reread Fields (-rereadfields) parameter. IMO the best practice is to have this turned off in non-prod so errors can be detected, but enabled in prod such that users are not effected by poor choice of fields phrases.
+1 I wanted to suggest the same rule!
Any news/update on this request? I was going to make a new post, but then I found this one :-)
@dominickdm The current model doesn't keep track of the referenced (or excluded) fields in a query. That has to be added in the model before working on the rule. I'll see how/when that can be done.