Skip to main content

C4C: Quickstart for UI Designer Scripting

Submitted by Stefan Barsuhn on

Just a few random tricks how to work with the UI DEsigner scripts:

  • a positive syntax check is necessary but not sufficient for your code to run (i.e. even if the syntax check says your code does not ccontain any error, that may not be true)
  • declare variables just like myvar = "ABC" - no need for "var" in the beginning  or ; or . at the end of the line 
  • an if works like this:
if (a == true)
return "abc"
else
return "def"
end
  • a for loop works like this (mind the 2 dots ..)
$data.ShowAdd = true
for i in 0..($data.DataList.Count-1)
if ($data.DataList.Get(i).ProcessingTypeCode == "ZPRO")
$data.ShowAdd = false
end
end
  • internal functions (StringUtils etc.) can be accessed using $controller - the dev guide has a handy reference for them