Functions

modified:

Functions are useful to save often used expressions which can be used in multiple contexts. The function is just preset or template which later on can be used inside expression builder as already predefined information to speed up expression creation process.

Functions are used in system processing when calculating values like cost or duration. You can create functions which can do mathematical equations with dynamic parameter data in processing context like operations, etc.



How to find Functions?



1. To find Functions, you should:

        1.1. Press ;

        1.2. Press ;

     

Now you can see Functions list



Basic parameter functionality:




ButtonWhat does it indicate?
You could edit Parameter
You could delete Parameter



 How to create new Function?




If you would like to create new Function, you could pressand create it.



1. To create new Function you need to press :

2. In dialog table enter name

3. Press


How to understand what is 'If' Conditions?


(7 > 12 ? 500 : 1000)

Condition
What does it indicate?
7 > 12
Condition "Is 7 is bigger than 12?"
? 500
if above condition is true, set 500
: 1000
if above condition is false, set 1000


(18 == 17 ? 500 : 1000

Condition
What does it indicate?
18 == 17
Condition "Is 18 is equal 17?"



How to create function you need?


Production name expression

year~'/' ~month~'/' ~day


Sign
What does it indicate?
year, month, day
It is date variable
~
It is a sign that stick different object
' '
It is sign within you need to write text (inside ' ' )
/It is your text


p(1) * p(4) + 1.3

SignWhat does it indicate?
pIt is parameters ( (p(1) - Colors) and (p(4) - Layer))

(1) (4)It is parameter's Id (you can choose parameters, pressand find it in a list. 
+ - * /It is mathematical signs 
1.3
It is a number you need


m(p(4))

FunctionWhat does it indicate?
m(p(4))
It is material parameter (which id is 4) and gives all information about this material


m(p(4)).getName()

FunctionWhat does it indicate?
m(p(4))
It is material parameter (which id is 4) and gives all information about this material
.getName()
You get particular material Name


m(p(4)).getInStock()

FunctionWhat does it indicate?
m(p(4))
It is material parameter (which id is 4) and gives all information about this material
.getInStock()
You get particular material Remnant


substr('PROMAN', 3, 2

Function
What does it indicate?
substr()
Takes data which is inside the brackets and take part of it (how to do it you could see below)
' ' It is text you need (inside ' ' )
PROMAN
It is your text
, 3
Starts taking form the fourth symbol (From text 'PROMAN', takes 'M' )
Note: 
if you want to get symbol, you must write one less
, 2
Takes 2 symbols from fourth symbol (From text 'PROMAN', takes 'M' and 'A')


df(order.customer, 'alias')

Function
What does it indicate?
df()
Takes dynamic field, which is inside the brackets
order.customer
Goes to Order Customer
' '
It is text you need (inside ' ' )
, 'alias'
Takes alias from Dynamic field (you could get more information about it here)


Other function

FunctionWhat does it indicate?
get_material(p(60))
 the same as m(p(60))
material_category_name(Paper)
Takes data from material, which name 'Paper' and gives all information about this material
material_alias(J1)
Takes data from material alias 'J1' and gives all information about this material
inval(p(10))Takes number from string type and makes them number type (integer)
floatval(p(10))Takes number from string type and makes them number type (real number)
order.Field['alias']Get Dynamic field Order type data particular alias (more information about Dynamic field you could get here)
7 > 12 and 7 < 12
Both conditions are true
7 > 12  &&  7 < 12
Both conditions are true, but if first condition is not true don't do anything
7 > 12  or  7 < 12
If one of conditions is true


There is a lot hidden by  button, which lets you customize what you see when previewing functions listing. Also, there are filters above each listing column which lets you quickly find and sort information which you've been looking for.