Documentation

userfieldconfig.update

Description and parameters

userfieldconfig.update({moduleId: string, id: number, field: {}})

Method updates field value.

Parameters

Class Description Available from version
moduleId Module string ID. Required.
id Field settings ID. Required.
field List with new field setting fields. Similar to the method userfieldconfig.add, but:
  • fieldName - cannot be modified
  • userTypeId - cannot be modified/li>
  • entityId - cannot be modified
  • editInList - cannot be modified
  • multiple - cannot be modified
  • isSearchable - modifying this flag won't automatically re-build search index. Rebuilding index occurs when entities with associated fields are modified
  • enum - full list of all value variants for "list" property type. To Чтобы это поле учитывалось, в fields должен присутствовать userTypeId
    • id - variant ID. Must be present to update the variant

Be cautious when handling value variants for lists.

Returned value and example

Returned value

Method returns the same data as the method userfieldconfig.get for updated field.

Examples

Updating flags and language phrases, without excluding value variants

{
    "moduleId": "rpa",
    "id": 170,
    "field": {
        "mandatory": "Y",
        "editFormLabel": {
            "en": "New field name"
        }     
    } 
}

Example for deleting all value variants.

{
    "moduleId": "rpa",
    "id": 170,
    "field": {
        "userTypeId": "enumeration",
        "enum": [
            [""]
        ]     
    }
}

Example of partial update for value variants.

{
    "moduleId": "rpa",
    "id": 170,
    "field": {
        "userTypeId": "enumeration",
        "enum": [
            {
                "id": 29,
            },
            {
                "id": 30,
                "value": "Updated value"
            },
            {
                "value": "New value"
            }
        ]     
    }
}

In this example:

  • value variant with id=29 remains unchanged,
  • value variant with id=30 changes value
  • adds new "New value" variant
  • all the rest of variants will be deleted

© «Bitrix24», 2001-2024
Up