Process Functions
Process Functions
The functions you can attach to a step of a process: what each one does and which parameters it takes. The most used ones come first, with examples.
Reference70 functionsParametersWhere functions are used
A function runs when a record reaches a step of its process. You choose it in two places (Work Flow):
- Function and Parameters of the step itself: one function per step;
- rows of Process automation for the same step: as many functions as you need, run before the function of the step.
How to write parameters
- Separate the values with a vertical bar
|, without spaces:template|staff_id|first_level_management_chain. - Field names are the names of the columns of the record (for example
staff_id,contact_id), not their labels. - Template names are the names in the module E-mail templates.
The most used functions
These five cover most processes: e-mails, your own checks in SQL, required fields and approvals.
SendEmail
Sends an e-mail made from a template of the module E-mail templates.
template_name|recipient_1|recipient_2|… Example: onboarding_new_employee_en|staff_json
| Recipient | Who gets the e-mail |
|---|---|
| a column of the record | The person in that field: an employee, a user or a contact, for example staff_id. |
| a column with an e-mail address, or an address | That address. |
first_level_management_chain | The manager one level above the employee. |
management_chain | The managers two levels above the employee. |
staff_json | The employees in the JSON field staff_json of the record, for example [1,2,3]; first_manager_json, second_manager_json, observers_json and budget_owners work the same way. |
__PRIV__GroupName | Everybody in that privilege group, for example __PRIV__Accounting. |
RawSQLWithUser
Runs an SQL function of your own, for checks or changes that no ready function covers. Parameter: the name of the function.
- The function takes two integers: the ID of the record and the ID of the user who changes the status.
- To stop the step, the function raises an error; its text is shown to the user. To let the step go on, it returns normally (for example
OK). - A returned text is not an error: it is added to the success message and the step goes on.
Example: check_overtime_cancellation on the step canceled of Overtime requests.
CheckIfFieldIsNotEmpty
Stops the step while one of the listed fields is empty. Parameters: feedback or several fields: contact_id|email.
RawSQL
Like RawSQLWithUser, but the SQL function takes only the ID of the record. Use RawSQLWithUser when you need to know who changed the status.
RequestApprovalWithSystemEmail
Sends an approval request to the managers of the requester. The managers approve or reject in Approval Requests, and OBS sets the status Approved or Rejected (Approvals).
- The module needs the option Approvals in the Constructor (it adds approved, approved_by, rejected …) and the steps
approvedandrejectedwith Manual status change off. - The requester must be an employee with a user.
- Parameters (all optional):
first_level_management(only the first-level manager), a field that points to an employee who also gets the request, an e-mail template, or a combination:field|template|….__approvers__|templateasks all employees in the JSON field approvers. - The request uses the template request_for_approval, unless you give another. For the decision you can add the templates <module>_approve and <module>_reject.
All functions
By topic. "only" means the function works in that module only.
E-mails and messages
| Function | What it does |
|---|---|
SendEmail | Sends an e-mail template. Parameters: template|recipient|recipient… (see SendEmail). |
SendEmailWithAttachment | Like SendEmail, and attaches a PDF of the record made from its document template. Same parameters as SendEmail. |
SendEmailWithLatestAttachedFile | Like SendEmail, and attaches the file uploaded last to the record. Same parameters as SendEmail. |
ChatMessage | Sends a push message to the OBS mobile app. Parameters: message|recipient|recipient…; the recipients are the same kinds as for SendEmail, or user IDs. |
RequestReview | Sends a review request by e-mail. Parameters: template|email1|email2. |
NotifyNextTaskAssignee | No description in OBS yet. Ask OBS support before you use it. |
Approvals and signatures
| Function | What it does |
|---|---|
RequestApprovalWithSystemEmail | Asks the managers of the requester for approval; the e-mails go from the system e-mail (see below). |
RequestApproval | The same approval, but the request e-mail goes from the personal e-mail of the requester. |
RequestApprovalCustomProcess | Approval by a list of approvers in several levels, returned by your own SQL function. Parameters: function|request_template|approved_template|rejected_template. Needs a sub-module <module>_approvers (copy expense_requests_approvers). |
RequestApproval_ApprovalTypes | Approval set up in the module Approval process types (who approves, for which module). |
ApplyDigitalSignature | Asks the user for the login password before the step and records the signature (Digital Signature). |
RequestSignatureWithEvrtorust | Makes a PDF of the record and sends it to Evrotrust for signing by the employee in the field staff_id. The module needs a text field name (Digital Signature). |
CreatePDFSnapshot | Creates a PDF snapshot of the record. |
Checks (stop the step when something is missing)
| Function | What it does |
|---|---|
CheckIfFieldIsNotEmpty | Stops the step while a field is empty. Parameters: one or more field names, contact_id|email. |
CheckForAttachment | Stops the step if the record has no attached file. |
CheckForAttachedEmail | Stops the step if the record has no related e-mail. The module needs Mailings turned on. |
CheckIfConditionIsMet | Stops the step unless a condition is true. Format: field_name[module.field_name <>= value]. |
ContactValidation | Checks that fields of a linked record are filled in. Example: record_id->contract_clients->client_id:field1|field2. |
CheckIfRelatedAreCompleted | Checks that the tick boxes of the related records are all ticked. |
CheckIfAllTasksAreCompleted | Checks that all assigned tasks are completed or rejected. |
CheckTaskCheckList | A task cannot be completed until all checklist items are done. |
CheckTaskDependencies | Checks that the tasks this task depends on are in the required status (Start-to-Start, Start-to-Finish, Finish-to-Start, Finish-to-Finish), as set in Task dependencies. |
CheckExpense | Checks that the related expenses are paid. |
CheckIncome | Checks that the related invoices are paid. |
CheckIfExpensesAreApproved | Quotations only: checks that all expenses of the quotation are approved. |
CheckIfWarehouseSlipExists | Checks that a warehouse slip for the document exists. Parameter: the status (ID) the slip must have. |
PickMaterialFromGroup | Stops the step if the recipe has a material group, and asks the user to pick a specific material. |
SQL, API and files
| Function | What it does |
|---|---|
RawSQLWithUser | Runs your SQL function with the record and the user (see below). |
RawSQL | Runs your SQL function with the record only. Parameter: the function name; the function takes one integer (the record ID). |
CallAPIEndpoint | Calls an OBS address built from fields of the record, for example /api/~~col_name~~/~~col_name1~~. |
FileOperations | Works with the files attached to the record, for example processes attached MT940 bank statements. |
Create and change records
| Function | What it does |
|---|---|
CopyRecord | Copies the record; the copy starts in the first status. |
ConvertDocument | Copies the document into another module by a column mapping set up in Module conversion mapping. Parameter: the name of the mapping. |
CreateProject | Creates a project from the record. The module needs project_id, deadline, issuer, contact_id and company_id. |
CreateProjectFromQuotationWithItems | Creates a project from a quotation, with its materials and products. |
CreateQuoteFromBudget | Creates a quotation from a budget. |
CreateQuoteFromProject | Creates a quotation (without items) from a project and links it to the project. |
CreateInvoiceFromOrder | Creates an invoice from an order. |
CreateInvoiceFromWorksheet | No description in OBS yet. Ask OBS support before you use it. |
CreateInvoicesFromContractPayments | Contracts only: creates the invoices of the payment plan, one per payment. |
CreateExpenseFromContract | Creates an expense from a contract. Parameters: key:value|key1:value1|…. |
CreateBulkPurchaseOrderFromOrder | Creates purchase orders (in Expenses) for the materials that are not in stock: minimum stock + minimum order quantity − quantity in stock. |
CreateEmploymentContractFromStaff | Staff only: creates an employment contract from the template employment_contracts. |
CreateStaffFromPotentialCandidate | Potential candidates only: creates an employee from the candidate. |
CreateSubRecords | No description in OBS yet. Ask OBS support before you use it. |
CreateWhSlipsFromTransfer | Creates the two warehouse slips of a warehouse transfer. |
RemoveRelatedRecord | Deletes a related record. Parameter: the field that points to it. |
StartProject | Sets the related project (field project_id) to started. |
MarkPaid | Ticks Paid on the record. |
ApproveRelatedExpenses | Approves all expense rows of the record. |
TransferToNextClass | Moves the items that are not completed to the next time. |
Warehouse and manufacturing
| Function | What it does |
|---|---|
AddQtyToWareHouse | Warehouse slips only: adds the quantities to the stock. |
RemoveQtyFromWarehouse | Removes the quantities from the stock. |
TransferQty | Warehouse transfers only: moves quantities from one location to another. |
BlockQTY | Blocks quantities in stock. |
BlockQtyInWarehouse | Blocks quantities in the warehouse. |
ReleaseQTY | Releases blocked quantities. |
AddQtyToAssetWareHouse | No description in OBS yet. Ask OBS support before you use it. |
RemoveQtyFromAssetWarehouse | No description in OBS yet. Ask OBS support before you use it. |
TransferAssetQty | No description in OBS yet. Ask OBS support before you use it. |
WarehouseTransfer | Manufacturing requests only: moves the product to another location. Parameters: SourceWarehouseID -> DestinationWarehouseID, for example 1 -> 2. |
ManufactureProduct | Manufacturing requests only: makes the product from its recipe. Parameters as WarehouseTransfer. |
ManufactureProductFIFO | Like ManufactureProduct; the materials are taken first in, first out. |
ManufactureProductLIFO | Like ManufactureProduct; the materials are taken last in, first out. |
ManufactureProductsAndTransferMaterials | Activity reports only: checks the stock of the materials (also inside products) and creates manufacturing requests and warehouse transfers. |
RollBackManufacturingRequest | Undoes a manufacturing request: deletes its products and materials from the warehouse slips and restores the quantities. |
OrderReversal | No description in OBS yet. Ask OBS support before you use it. |
Tenders and surveys
| Function | What it does |
|---|---|
StartBulk | Tenders and Surveys only: creates one participant record per recipient, with a copy of the questions. Add the participants first. |
InformRecipients | Tenders and Surveys only: e-mails each participant the link to the tender or survey. Add system_email to the parameters to send from the system e-mail. |
CompleteSurvey | Tenders only: starts the negotiation with the selected winner; the winner confirms the final price through a link in the e-mail. |
FAQ
A function I need is not in the list.
Can a step have two functions?
Why is RequestSignatureWithEvrtorust spelled like that?
Related: Work Flow · Digital Signature · Document Templates.
