Home > @poq/sdk-sfcc > BaseModel > setPropertyValue
Method helps to set custom properties of object since they are not defined in schema.
Signature:
setPropertyValue<T>(propertyName: string, value: unknown): void;
Parameter | Type | Description |
---|---|---|
propertyName | string | Property name. |
value | unknown | Value of the property. |
Returns:
void
Value of the property.
// For OCAPI models custom properties should go with `c_` prefix.
// Code set property that is not defined in original model.
instance.setPropertyValue('c_someCustomProperty', value);