I
I
Ilya Tsarenkov2021-11-06 01:21:40
Bitrix24
Ilya Tsarenkov, 2021-11-06 01:21:40

Why does CRest::call("crm.company.update add json when data changes, how to pass very long data correctly??

What am I doing literally I need to update the field at the company

$patch_string="crm.company.update?id=149&fields[UF_CRM_1633453521]=Нет описания компании..1"
CRest::call($patch_string);

At the output in CRM I get in this field
"
No company description..1 json
"
Question! How to remove "json"
Question 2 I need to pass a long text, but it obviously won't fit in the get request, what should I do??

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2021-11-11
@gromdron

Look at the method signature and you will see that it looks like this: That is, everything that you are so carefully trying to write in patch_string, you can pass it as an array to $params and it will collect it by itself. When you pass everything to a query you are limited by the length of the query (on some systems 200, on some 500 characters), but the POST size has a lot more options.
public static function call($method, $params = [])

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question