I
I
IvanovIvanIvanych2020-07-18 21:27:42
1C-Bitrix
IvanovIvanIvanych, 2020-07-18 21:27:42

How to pass a link to the deal field without overwriting previous links using the crm.deal.update method?

Hello, please tell me, if I pass a link in the deal field using the crm.deal.update rest method, how to make sure that each new link is added to the additional field of the field to which I transfer, and does not replace all added links in additional fields ?

The field type is "link", within this field you can create additional fields, they do not have their own identifiers. If you request information about the deal via rest, then additional fields and their contents will be displayed like this:
UF_CRM_1594993829087] => Array (
[0] => vapvapr
[1] => yvapyvap
[2] => 5pkevyap
)

When forming the fields parameter array for the crm.deal.update method, I can specify that the next link will be with the "3" key in the parameter array:
$DEAL_URL[3] = $URL_COMPLETE;
$DEAL_FIELD[UF_CRM_1594993829087] = $DEAL_URL;

But this link will still overwrite and destroy everything contained in the additional fields.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman, 2020-07-19
@Ramapriya

1. Make the field multiple
2. Add a value to the array:
$DEAL_FIELD['UF_CRM_1594993829087'][] = $DEAL_URL;

A
Andrey Nikolaev, 2020-07-19
@gromdron

But this link will still overwrite and destroy everything contained in the additional fields.

The crm.deal.update method will change not a specific item, but all values. There are no methods for dot addition of elements, so you will have to get all the values, add your link and save.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question