Class CustomFormApi.UpdateApi
- Enclosing class:
CustomFormApi
doUpdate
.
Note that no permissions are checked when updating the custom form.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondoUpdate()
Finishes the update operation.setAttributeExtension
(Map<String, Object> attributeExtension) Adds a customattributeExtension___key:value
field to the CustomForm or replaces an existing one – performs a full replacement of theattributeExtension
map (does not update specific keys or values).setAttributeExtensionValue
(String name, Object value) Updates the value of an existingattributeExtension___key:value
field or creates a new one.setAttributeValue
(String attributeName, Object value) Updates the value of the specified 'attributeXX' column of the CustomForm class.
Example:setInputValue
(String name, Object value) Sets the value for an input.setUserGroupEdit
(String userGroups) Updates the value ofuserGroupEdit
.setUserGroupViewDetails
(String userGroups) Updates the value ofUserGroupViewDetails
.
-
Method Details
-
setLabel
-
setUserGroupEdit
Updates the value ofuserGroupEdit
.Example:
api.customFormApi() .withId(344) .updateData() .setUserGroupEdit("sales_managers") .doUpdate()
- Parameters:
userGroups
- the name of an existing user group- Returns:
- instance of
CustomFormApi.UpdateApi
- Since:
- 11.1 - Paper Plane
-
setUserGroupViewDetails
Updates the value ofUserGroupViewDetails
.Example:
api.customFormApi() .withId(344) .updateData() .setUserGroupViewDetails("sales_managers") .doUpdate()
- Parameters:
userGroups
- the name of an existing user group- Returns:
- instance of
CustomFormApi.UpdateApi
- Since:
- 11.1 - Paper Plane
-
setInputValue
Sets the value for an input.- Parameters:
name
- the name of the inputvalue
- the value for the input. Can be a simple value, like an Integer or a String, or can be a matrix value, with rows delimited by square brackets.- Returns:
- the same instance of this class
-
setAttributeExtension
Adds a customattributeExtension___key:value
field to the CustomForm or replaces an existing one – performs a full replacement of theattributeExtension
map (does not update specific keys or values). To update a particular value, use thesetAttributeExtensionValue(java.lang.String, java.lang.Object)
instead.setAttributeExtension
might be useful for setting theattributeExtension
from scratch or for mass actions.Information: To view the attributeExtension via UI, add the attribute extension field first – navigate to the CustomForm header context menu (three dots next to the column label) > Customize Attribute Extension. Add the name of the AttributeExtension key you want to display in the table.
Otherwise, AttributeExtension fields are stored in the database only and are not visible in the user interface. AttributeExtension fields can be fetched with the given CustomForm object.Note: This operation only works in contexts that allow object modification. This method cannot be used in a distributed calculation. Do not use within the input generation mode.
Example:
api.customFormApi() .withId(customForm.id) .updateData() .setAttributeExtension(["key1": "value1", "key2": "value2"]) .doUpdate()
- Parameters:
attributeExtension
- A map of additional custom attributes of the CustomForm- Returns:
- The instance of
CustomFormApi.CustomFormBuilder
- Since:
- 11.1 - Paper Plane
- See Also:
-
setAttributeValue
Updates the value of the specified 'attributeXX' column of the CustomForm class.
Example:api.customFormApi() .withId(customForm.id) .updateData() .setLabel("New Label") .setInputValue("input1000", 1001) .setAttributeValue("attribute15","Tofu003") .doUpdate()
- Parameters:
attributeName
- The name of the attribute to update. For example, attribute15.value
- The value of that attribute.- Returns:
- the same instance of this class
-
setAttributeExtensionValue
Updates the value of an existingattributeExtension___key:value
field or creates a new one.For mass operations (to add or replace multiple keys and values within the object), use the
setAttributeExtension(Map)
instead.Example:
api.customFormApi() .withId(customForm.id) .updateData() .setLabel("New Label") .setAttributeExtensionValue("name", "value") .doUpdate()
- Parameters:
name
- existing field namevalue
- new value- Returns:
- the same instance of this class
- Throws:
XExpression
- if error occurs or if the field specified by the field name does not exist- Since:
- 11.1 - Paper Plane
- See Also:
-
doUpdate
Finishes the update operation. When this is executed, the Custom Form will be updated in the database.Note: Since 12.0.0, this operation only works in contexts that allow object modification. The previous behaviour can still be achieved by using the 'customFormApiAlwaysAllowsObjectModification' application property.
- Returns:
- an Object containing the data of the updated Custom Form
- Throws:
XExpression
- if the custom form fails validation with the specified data The data that can be extracted is:- id
- uniqueName
- label
- attributeXX (1..30)
- inputs (the specific type of the inputs can vary)
- outputs (the specific type of the outputs can vary)
- See Also:
-