Table of Contents

Developer

Work in progress (notify on update)

Advanced configuration of forms

 

It is possible to set a dynamic values as default value using Javascript.

The most common used is setting time or date

Select <> instead of the calendar and inset your oneline code.

 

Samles for that is setting time/date

Set time/date

<date> ı <offset>

now() | dateMinus({days: 1})

 

‘2021-10-01’ | datePlus({years:1})

 

now() | datePlus({months: 3})

now() | dateMinus({hours: 8})

now() | datePlus({minutes: 45})

 

dateFns.addDays(new Date(),10)

 

 
 

addSeconds(date, amount)

dateFns.addSeconds(new Date(),10)

addMinutes(date, amount)

addHours(date, amount

 

subHours(date, amount)

// the last hour

dateFns.subHours(new Date(),1)

 

subHours(date, amount)

subDays(date, amount)

addWeeks(date, amount)

subWeeks(date, amount)

 

addMonths(date, amount)
addQuarters(date, amount)

addYears(date, amount)

 

interval/duration

differenceInHours(dateLeft, dateRight)

differenceInDays(dateLeft, dateRight)

The full documentation for the classed used to handle date and time, can be found here

 

The full documentation for the external REST calls, can be found here

user.id

 

 

var ret = new List(“users”);
ret.filter(“f_name”,“!=”,“Jackie”);
ret.filter(“f_name”;“!=”,“Pedro”);

 
filters: {
type: ‘FILTER_GROUP’,
logicalOp: ‘AND’,
filters: [
{
type: ‘FILTER’,
fieldApiName: ‘name’,
comparator: ‘is not’,
value: ‘Jackie’,
}, {
type: ‘FILTER’,
fieldApiName: ‘name’,
comparator: ‘is not’,
value: ‘Pedro’,
},
],
 
Copy the filter to clipboard and insert in data
 
filter pop-up
Advanced forms
Advanced forms
Advanced forms
Advanced forms
use user object

Dynamicly use information from the user creating an record. The same values can be utilised in the update metode, and in scripts

user.first_name

user. last_name

user. email

user. phone

user. country

user. country_code

user. state

user. city

user. street_address

user. postal_code

user. organization. name

sample user object

Advanced use of  Workflows

How a Developer can work with Workflows

currentRecord
user
organisation
variables 

currentRecord.f_some_field = ‘something’
variables.x = 10;

Workflow triggers

Workflow can be triggered on create of a record or on update of the record.

It can also be triggered on time reaccouring with a user defined interval. if special time based definitions is required, that can be done using a cron job.

Details on how to define a cron job can be found here 

Working with time

// variables.timeToGo in hours
var now = new Date().toISOString()
variables.timeToGo = ( Date.parse( currentRecord.f_deadline ) – Date.parse( now))/1000/60/60;
 
await Mail.send(‘john@done.com’, ‘This issue for you’, currentRecord.f_title);

// Variables
const listApiName = “ansaettelsessystem”;
const data =
{
filters: {
type: ‘FILTER_GROUP’,
logicalOp: ‘AND’,
filters: [
{
type: ‘FILTER’,
fieldApiName: ‘f_tite’,
comparator: ‘contains’,
value: ‘chef’
}
],
}
}
// Run the methods and store the result in a variable
const result = await Record.getAll(listApiName, data)

// Test print the result
var res = result.items // JSON.stringify(result.items)

var text=“”;
for (let i = 0; i < res.length; i++) {
text += res[i].f_tite + “<br>”;
}
 
currentRecord.f_text= text ;
 

Create record in a table

//Variables
const listApiName = “sagsbehandling”;
const data = {
“f_title”: currentRecord.f_title,
“f_sagsid”:variables.id
};

//Get field api names for the new data set
const result = await Record.create(listApiName, data);

Working with date and time

 
variables.x= currentRecord.f_deadline
var y= new Date().toISOString()
//z is duration in hours
variables.z = ( Date.parse( variables.x ) – Date.parse( y))/1000/60/60;

Delete all record in a table

// Variables
const listApiName = “table”;
const params = “”;

// Run the method and store the results in a variable
const result = await Record.getAll(listApiName);

// Test print the result
for(x=0;x< result.items.length;x++){

await Record.delete(listApiName,result.items[x].id);
 
}

Delete all records in a table

const listApiName = “table”;
const params = “”;

const result = await Record.getAll(listApiName);

// Test print the result
 
for(x=0;x< result.items.length;x++){
await Record.delete(listApiName, result.items[x].id);
}
 
 
 

 

 
 
 
 

Recommandation

If you have dependent async calls (await) then don’t run them in the same activity. to make sure that the workflow handle the syncronization.

like, lookup in a list, based on the result update another record

If reference values are blank in the workflow log, then workflow user of that list might not have access to the referred list.

Workflow execution 

Workflow execution can time out.
If you create an external call, you shoud make sure that the source you are triggering response [umiddelbart], since the workflow activities are not designed for waiting.

builld in classes

List

Record

Mail

use the  API

How a Developer can utilise the Rest API (outbound)

How a Developer can utilise the Rest API (inbound)

 

Security Setup i BusinessMate.


Security is based on roles setting permissions

Groups issue assigned roles

Users are members of groups

Users and groups are controlled by the tenant admin.

Tenant admin, import, create, maintain users and groups.

List is controlled by List admins

List admins, when creating a list they become list admin for that list via a list admin group, there can be added additional members to that group, giving them the owner permissions.

The list owner can configure a list, the related form, workflows, roles & permissions and settings,

The list owners assigned the roles they create to groups, addressing relevant users. 

A role can hold the following permissions

Can Create,

Having this permission you can create a record on the related list. If you have to se the submitted record then thee group needs to have that permission as well

Can Read

Having this permission you can read records in a list, the permission can be given with a filter reducing the amount of records in list that is readable. 

a filter could be created by you or assigned to you. 


Can Update

Having this permission you can update records in a list, the permission can be given with a filter reducing the amount of records in list that is readable.

To work properly you need to have en read permission aswell

Can Delete

Having this permission you can archive records in a list. Normally this permission is given to a superuser of the process or a supervisor, the permission always comes with the owner. 

Having this permission also gives the user permission to “unarchive” a record. 

Can Force Delete

Having this permission you can delete a record. A forced delete record can’t be restored.

See KPI

Having this permission you can se and use KPIs related to the list. Having this permission gives you the option to have the KPI on your homescreen.

is Owner

Having this permission gives you full control over the list, 


Example on how to use:

I many processes there are something like a user/rerquester/ customer to the process.

they would in many cases have the option to create, read and update own records in the primary list, and read records in supporting lists.

I must processes there are predefined groups that can be fulllfiller to the process, you can normally create, read, update all records in the lists related to the process

I some cases then can do the archiving, in other cases the archiving is done by managers of the process, having process managers the are often responsible for maintaining data supporting the process, when that is in additional lists.


 

Sampe setup: