Cheatography
https://cheatography.com
D365 F+O Development cheat sheet
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Variable Declaration
str customerName; // data type must be declared
str customerName = "Name";
const str constantVariable = "Value";
|
Primitive Data Types
|
dd/mm/yyyy |
|
named list of literals |
|
globally unique identifier |
|
32-bit wide integer |
|
64-bit wide integer |
|
number values with decimals |
|
String |
|
number of seconds since midnight |
|
Combination of date
and timeOfDay
|
Access Identifiers
[public] |
Can be called from anywhere |
[protected] |
called from methods in class/subclass |
[private] |
only called in method where declared |
Printing Infolog to Screen
info("This is an info log message.");
|
Error Handling
throw error("This is an error.");
|
Try...Catch
try
{
//Run some code
}
catch (Exception::Numeric)
{
info('Found a Numeric exception.');
}
catch
{
info('Caught an exception');
retry;
}
finally
{
// Executed no matter how the try block exits.
}
|
|
|
Arithmetic Operators
<< |
int a = 1<<2;
\\(1 x 2 x 2) |
>> |
|
* |
multiplies |
/ |
divides |
|
divides left value by right value |
|
divides with a remainder |
~ |
performs a binary NOT
operation |
& |
performs a binary AND
operation |
^ |
|
| |
|
+ |
addition |
- |
subtraction |
? |
int x = 4; result = (x ==5) ? "Yes" : "No";
|
Relational Operators
|
SQL statement, returns criteria if true |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If Statement
if (x == 5)
{
info('x equals five');
}
|
If...Else Statement
if (x == 5)
{
info('x equals five');
}
else
{
info('x does not equal five');
}
|
Switch Statement
switch (x){
case 5:
//do something
break;
case 10:
//do something
break;
default:
//do something
break;}
|
While Loop
int loopCount = 1;
container cont;
while (loopCount <= conlen(cont)) {
print conpeek(cont,loopCount);
loopCount = loopCount + 1;
}
|
For Loop
for (int i=1; i<=100; i+=1){
print ra[i];
}
|
|