Update Values of List Properties catalog.productPropertyEnum.update

We are still updating this page

Some data may be missing — we will complete it shortly.

Scope: catalog

Who can execute the method: any user

catalog.productPropertyEnum.update(id, fields)
        

Method for updating values of list properties.

Parameters

Parameter

Description

id
integer

Identifier of the product or variation property

fields
object

Fields corresponding to the available list of fields fields

Required parameters are marked with *

Examples

try
        {
        	const response = await $b24.callMethod(
        		'catalog.productPropertyEnum.update',
        		{
        			id: 122,
        			fields: {
        				propertyId: 128,
        				value: "Medium",
        				def: "Y",
        				sort: 1234,
        				xmlId: "M"
        			}
        		}
        	);
        	
        	const result = response.getData().result;
        	if(result.error())
        	{
        		console.error(result.error().ex);
        	}
        	else
        	{
        		console.log(result);
        	}
        }
        catch(error)
        {
        	console.error('Error:', error);
        }
        
try {
            $response = $b24Service
                ->core
                ->call(
                    'catalog.productPropertyEnum.update',
                    [
                        'id' => 122,
                        'fields' => [
                            'propertyId' => 128,
                            'value' => "Medium",
                            'def' => "Y",
                            'sort' => 1234,
                            'xmlId' => "M",
                        ],
                    ]
                );
        
            $result = $response
                ->getResponseData()
                ->getResult();
        
            if ($result->error()) {
                error_log($result->error()->ex);
                echo 'Error: ' . $result->error()->ex;
            } else {
                echo 'Success: ' . print_r($result->data(), true);
            }
        
        } catch (Throwable $e) {
            error_log($e->getMessage());
            echo 'Error updating product property enum: ' . $e->getMessage();
        }
        
BX24.callMethod(
            'catalog.productPropertyEnum.update',
            {
                id: 122,
                fields: {
                    propertyId: 128,
                    value: "Medium",
                    def: "Y",
                    sort: 1234,
                    xmlId: "M"
                }
            },
            function(result)
            {
                if(result.error())
                    console.error(result.error().ex);
                else
                    console.log(result.data());
            }
        );
        

How to Use Examples in Documentation