Groovy API for Custom Form Manipulation

Since version 9.0

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

Retrieve API object

Groovy
api.customFormApi()   //❶

❶ Returns a CustomFormApi object.

Create New Custom Form Instance

Groovy
def customForm = api.customFormApi().newCustomForm()
        .setLabel("my custom form 1")
        .setTypeId(1)   //❶
        .setUserGroupViewDetails("viewGroup")
        .setUserGroupEdit("groupEdit")
        .create()

❶ ID of the CustomFormType.

Update Existing Custom Form Instance

Groovy
api.customFormApi()
    .withId(customForm.id).updateData()
        .setLabel("after label")
        .setInputValue("input1000", 1001)
        .setAttributeValue("attribute1","attribute1")
        .doUpdate()