Skip to main content
Matrix42 Self-Service Help Center

JavaScript Library for Layout Designer

Overview

Out of the box, the SolutionBuilder delivers the library of the JavaScript functions which are helpful for using in the Layout Designer Calculated Fields. 

mx.Schema.getPickup Get the Schema Pickup data by internal Pickup name
   

Promises

In modern HTML application (like UUX) any function call which could lead to Server Request is an asynchronous function, which does not return the web service result immediately, but only the reference to the callback function, which be executed when the response from Server will be received. To simplify the syntax, the SolutionBuilder functions returns a Promise, the object which represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. Please read more about Promises, and how to use it here.

mx.Schema

Provides the set of function for working with the Data Layer functions, like obtaining the Schema metadata or get the data

getPickup(string)

Get the Schema Pickup data by internal Pickup name

Parameters

name (String) - technical name of the Schema pickup

Returns

Promise to Object with the requested Schema Pickup data, of the following format

{
   [value1]: {Value: value1, DisplayName: "name", Image: "", Color: "", ..},
   [value2]: {Value: value2, DisplayName: "name", Image: "", Color: "", ..},
   ..
}

System returns null, if the Pickup with the provided name not found

Example

Example dynamically receives the Image for the Pickup value, which are defined in Input controls

GetPickup.png

 

if(pickupName.$hasChanges || pickupNumber.$hasChanges){    
  return mx.Schema.getPickup(pickupName.$value).then(function (data){
     return data[pickupNumber.$value].Image;
   });    
}return $value;

 

 

  • Was this article helpful?