Internal $D methods

Basic functions

Get field value of the current object $D.getValueFromTemplate() or $D.eval()

$D.getValueFromTemplate = function(fieldName[string])
// the same but shorter:
$D.eval = function(fieldName[string])
// examples
var name = $D.getValueFromTemplate("{{name}}") // name == Ivan
// you also can get values from linked objects
var phone = $D.getValueFromTemplate("{{author_id.phone}}") // phone == 79141230000
// tip: for getting data from arrayLinks use $D.store.get()

Get an object from different structure $D.store.get()

$D.store.get = function(structName[string], objectID[string], fields[object])
// example
var object = $D.store.get("WebUser", "7967", {fields: ["phone", "role"]});
// object == { role: "candidate,admin", phone: "79670190000", id: "7967" }

Save an object $D.store.save()

$D.store.save = function(structName[string], obj[object], createEvent[boolean])
// example
var ID = "10341"
$D.store.save("WebUser", {"id": ID, "stringF": "Changed string value" }, true)
// note that if createEvent == false, no event will be created,
// so the scenarios will not trigger

Console log $D.console.log()

$D.console.log = function(string)
// example
$D.console.log('a = ' + a)

Additional functions

Save file to the internal file storage $D.fs.download

Function downloads the file and saves it to the File storage

$D.fs.download(fileUrl[string])
// example
var fileUrl = $D.fs.download("https://booble.com/files/logo.png")
// fileUrl == "https://api.directual.com/fileUploaded/uao/2a10d948-2e2e-49cb-9987-54f00cd6528d.png"