Give us contact

Do you prefer to ask us directly?

Call us +420 605 203 938 (the Czech Republic)

or use this contacts

AyMINE

Related links


FI - Finance Management

New object at created at the server

Guidelines how to create new object at the server and open the detail view with new object.

When pattern used

Pattern is used, when user creates object:

  • Object is linked in complex structured that should be set directly before user can edit object
  • When more than single object is created at once
  • When object should have pre-set attributes that cannot be set by default from jsonc

Pattern

Pattern is defined in the script orchestration

Step 1: Request object by client:

User starts operation that request new object. Operation is used instead common insert

"server.tskEvent.createNewRaised(tskAreaID=@oAttr.tskAreaID)",

Step 2: Server creates object

Server creates object and returns it's id in return attributes:

$resp = Response::OK();
$resp->addRetVal('newID', <$newObjectID>);
return $resp;

Step 3: Client opens object

Client opens detail and passes the return field to the oID attribute of the detail

"form.<objectName>.detail.(oID=@fAttr.newID,location=modal)",

Notes:

  • Name of the returned field (newID in this case) is not predefined; @fAttr should be used to pass the attribute, not the object field oID.
  • Field oID – when defined as a attribute – is automatically set to be from the viewDef attribute group, so that explict definition oID:viewDef= is not necessary.

Complete example

Complete orchestration method is from tskEventObjectRel:

"newRaised":{ "icon":"new", "multi":0, 
   "command":[
      "server.tskEvent.createNewRaised(tskAreaID=@oAttr.tskAreaID)",
      "form.tskEventObjectRel.detail.raisedEvent(oID=@fAttr.newID,location=modal)",
      "window.reload"
   ]
}