Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

F.ex. if the script is run to generate the value for a task custom field, the context is the task. The context is accessed through the object named this. Script objects that represent objects in Microbizz (tasks, companies etc) provide a few functions:

Function

Example

Description

gv(fieldname)

field = "customername"

this.customer.gv(field)

Read a named field from the object

gvd(fieldname)

this.gvd("price")

Reads and formats a named field from the object

indb()

if !this.customer.indb()

failed = true

Check if the object is in the database, f.ex. you can check if the task refers to an existing customer

If you are using the new syntax: Refer to the API documentation for details about the various objects. Some objects allow you to easily access other objects that are somehow connected, e.g. if this is a task, then this.user is the responsible user for the task.

Notice that the new syntax is still very experimental, you should probably use the old syntax. As Microbizz migrates to the new + modules (Task+, CrM+ etc) the new objects in these modules will have the same field names in the API as internally and so there will be no new / old syntax.

Microbizz object

Documentation

List of connected objects

Customer

Micropedia - the "customer" object

this.person

this.user

EdiInvoice

Micropedia - the "edi" object

this.todo

this.user

this.customer

Equipment

Micropedia - the "tool" object

this.placeofhome

this.user

Invoice

Micropedia - the "invoice" object

this.user

this.customer

InvoiceLine

Micropedia - the "invoiceline" object

this.todo

this.customer

Person

Micropedia - the "person" object

Project

Micropedia - the "project" object

this.user

this.customer

Registration

Micropedia - the "registrationentry" object

this.todo

this.user

this.customer

Task

Micropedia - the "todo" API object

this.customer

this.user

this.project (same for both new and old projects)

User

Micropedia - the "user" object

Product

Micropedia - the "product" object

Planning

Micropedia - the "prodplanentry" object

Quotation

Micropedia - the "salescontract" object

this.customer

this.user

Appointment

Micropedia - the "event" object

this.user

this.customer

...