Status Change Order - Change status depending on revenue lines
General
This page contains the JSON of the function-set: Change status order depending on revenue-lines. If on the ordercheck only a manual check is performed if revenue-line exists this can be automatated by appling this functionset. The functionset will check if revenue lines exists and changes the status to: 70-TOINVOICE if revenue lines exists. If no revenue lines exist the status of the order will be changed to 60-TOCHECK.
Json code snippet: STATUSCHANGE_ON_REVENUE
{
"FunctionSet": {
"TableNo": 11172786,
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "IF",
"Description": "If revenue exist set status:70-TOINVOICE else 60-TOCHECK",
"Parameters": [
{
"ParameterName": "CONDITION",
"ResultFunctionSetID": {
"FunctionSet": {
"TableNo": 11172786,
"DataType": "34047",
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "COMPARE",
"Parameters": [
{
"ParameterName": "VALUE1",
"DataType": "0",
"ResultFunctionSetID": {
"FunctionSet": {
"TableNo": 11172786,
"DataType": "12799",
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "SUM",
"Parameters": [
{
"ParameterName": "TABLENO",
"Value": "11172787"
},
{
"ParameterName": "FIELDNO",
"Value": "51"
},
{
"ParameterName": "FIELD 1",
"Value": "1"
},
{
"ParameterName": "FILTER 1",
"Value": "2"
},
{
"ParameterName": "FIELD 2",
"Value": "2"
},
{
"ParameterName": "FILTER 2",
"ResultFunctionSetID": {
"FunctionSet": {
"TableNo": 11172786,
"DataType": "31488",
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "FIELD",
"Parameters": [
{
"ParameterName": "FIELDNO",
"Value": "2"
}
]
}
]
}
}
},
{
"ParameterName": "FIELD 3",
"Value": "10"
},
{
"ParameterName": "FILTER 3",
"Value": "2"
}
]
}
]
}
}
},
{
"ParameterName": "VALUE2",
"Value": "0"
}
]
}
]
}
}
},
{
"ParameterName": "ON TRUE",
"Value": "3718",
"ValueFunctionSet": {
"FunctionSet": {
"TableNo": 11172786,
"DataType": "34047",
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "SET STATUS GEN.",
"Parameters": [
{
"ParameterName": "NEW STATUS",
"Value": "60-TOCHECK"
},
{
"ParameterName": "REASONDESC",
"Value": "No revenue on order"
}
]
}
]
}
}
},
{
"ParameterName": "ON FALSE",
"Value": "3719",
"ValueFunctionSet": {
"FunctionSet": {
"TableNo": 11172786,
"DataType": "34047",
"Entries": [
{
"EntryNo": "10000",
"CodeunitID": "11172846",
"FunctionCode": "SET STATUS GEN.",
"Parameters": [
{
"ParameterName": "NEW STATUS",
"Value": "70-TOINVOICE"
}
]
}
]
}
}
}
]
}
]
}
}