Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
Since version 9.0

If you need to create/update/delete instances of CustomForm Custom Form from any kind of logics, you can use the Custom Form API.

Retrieve API object

Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.customFormApi()   //❶

returns Returns a CustomFormApi object.

Create

new

New Custom Form

instance

Instance

Code Block
languagegroovy
themeMidnight
linenumbersfalse
def customForm = api.customFormApi().newCustomForm()
        .setLabel("my custom form 1")
        .setTypeId(1)   //❶
        .setUserGroupViewDetails("viewGroup")
        .setUserGroupEdit("groupEdit")
        .create()

❶ ID of the CustomFormType.

Update

existing

Existing Custom Form

instance

Instance

Code Block
languagegroovy
themeMidnight
linenumbersfalse
api.customFormApi()
    .withId(customForm.id).updateData()
        .setLabel("after label")
        .setInputValue("input1000", 1001)
        .setAttributeValue("attribute1","attribute1")
        .doUpdate()