From Dreamtsoft Wiki
Jump to: navigation, search

My extender is not creating a new record in data services


Is the location of a file that has an Id of the extender that will register with the postgres db. If you already registered this extender in one space you can't move it to another space.

Delete the file and restart the extender

In a workflow how do I navigate by replacing url parts

To keep the same navigation menus (keep the page within a page) you will populate the individual parts of the URL (Component, Layout, Extra Info). For a new page you can populate the “Pages” field with the page info (e.g. details.default.account)


How to use other scriptables other than FRecord Scriptable

I attempted to use the “getLifecycleStates” scriptable but I did not have “something” to call it like I do when I create an FRecord and then do FRecord.addSearch()

In order to user the “getLifecycleStates” I needed to include it

How to get related records (or children)?

var fr = new FRecord('major_incident');
var ri = fr.getRelated('incident', 'parent');

How do you require a module script in another script?

Make sure you include the bundle in the path

var DemoDataGenerator = require("ds.it4it/demo/DemoDataGenerator");
var ddg = new DemoDataGenerator();

How do you add multiple email addresses to the notification action in a workflow


//double-pipe with no spaces //this is also how you would add values to a widget choice via script if you have multiple choices

How do I run scripts in a lower space

You can run scripts in a lower space using the ScriptRunnerScriptable

This allows you to create a function (myFunction) and pass as many arguments (1, 2) as your function needs. These arguments can be anything from a string, to an object, to an array. You will need to set the space with setSpace();

const ScriptRunnerScriptable = require("core/ScriptRunnerScriptable");            
let TestProcessor = Class.create({
 process: function() {
  let runner = new ScriptRunnerScriptable(); 
   //You can set the space dynamically from an FRecord
 runner.callFunction(myFunction, 1, 2);
 className: "TestProcessor"
module.exports = TestProcessor;
function myFunction(param1, param2) {
 console.log("Running myFunction2 with " + param1 + " and " + param2);        

How do I populate choices in a choice picker in a workflow

You can use the flow variables by clicking the plug. Make sure your script sets the variable to action.output.[VARIABLE NAME] and in a JSON object in value:xxxx label:xxx format


action.output.test = [{value:"Donovan", label:"Stone"}];

How do I get the site URL and space in a script?

var site = Configuration.getSiteURL()

How do I debug in Dreamtsoft?

To turn debugging on you can use the keyboard shortcut control + shift + D. You will see a message at the bottom right of your screen saying "debug console on" if you were successful. From there go to your toolbar and click View->Developer->JavaScript console.

I am trying to create an automated number to use as an ID for things i create, for example s001, s002, s003

There is a number component that you can add as a slot. This component will assign a random number to that slot. In order to customize what number will show up you need to first set a "number definition". Click the gears icon->"misc"->"Numbers". From there you can add a definition. Then when you go back to your number slot you can click "use definition" checkbox and what you just created will be there.

How to get access to a picture uploaded into a image slot in a bucket

The following script will use the FRecord API to search for an record and console log the URL of that image

var fr = new FRecord("user");
fr.addSearch('user_id', 'bow');
if (fr.next()) {
    console.log("DISLAY: " + fr.getDisplayValue('image'));
    console.log("toURL: " + fr.image.toURL()); // save as above
    console.log("Full URL: " + Configuration.getSiteURL() + "/" + fr.image.toURL());

Emails are not sending or receiving from my Gmail account

In order to have Gmail be your primary email account you must turn off Secure Apps. See the google support article below