...
Code Block | ||
---|---|---|
| ||
def records = api.find(...) for (record in records) { //do something with with record.attribute1 ... } |
Groovy
...
Functions
The general rule is to make the first letter lowercase. Even though Groovy, compared to Java, allows the first letter in uppercase, it is recommended to follow the Java convention.
Example: getCostPrice()
Data gathering functions should use a common prefix. This will significantly help when identifying performance problems. Remember that function should only do one thing at a time = either gather data or manipulate the data somehow, not mix.
Proposal:
- Functions that are querying Price Builder (= calling functions api.find() or api.findLookupTableValues()) use prefix "find" e.g. findSalesOrgs().
- Functions that are querying Price Analyzer (= calling executeQuery or executeSqlQuery)) use prefix "load" e.g. loadTransactions().
DF/DS/DM Fields
The general rule is to make the first letter in uppercase.
...