E
E
Evgeny Nikolaev2021-09-29 15:21:48
1C-Bitrix
Evgeny Nikolaev, 2021-09-29 15:21:48

Why, when registering a user via API in Bitrix, the error “Jur. Faces?

It was necessary to complete the registration form on the Bitrix site, I wrote the code

global $USER;

    $arFields = Array(
      "EMAIL"=>$email,
      "LOGIN"=>$login,
      "ACTIVE"=>"Y",//Делаем пользователя активным
      "PASSWORD"=>$pass,
      "CONFIRM_PASSWORD"=>$pass2,
      "UF_INN_ID"=>$inn,// Добавляем пользовательское поле(они всегда начинаются с UF_)
      "UF_BU_ST"=>"N",
      "UF_F_NAME"=>"Не указано"
    );

    $id = $USER->Add($arFields);
var_dump($arFields);var_dump($id);echo $USER->LAST_ERROR;


Began to understand why $id = $USER->Add($arFields); returns false for which echo $USER->LAST_ERROR; and it displays "The data of the Legal Entity are not specified." The code I add worked on another online store. There is an assumption that this is not a standard Bitrix error, but created by the developers of this particular site. Where to look? How to understand the absence of which field swears?

I also looked in the list of Bitrix users for the fields that are indicated for existing users. In the parameters, it seems, I pass everything that I need.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Novozhilov, 2021-09-29
@nikolaevevge

The simplest thing is to look for the text of this error throughout the code.
If you don’t have a project locally, don’t have code in git, don’t have access to the server console (to search there using grep), then unwind the chain from the file /local/php_interface/init.php or /bitrix/php_interface/init.php (depending on what is).
You need an OnBeforeUserAdd handler, look for it.
If not there, look at the installed custom modules, look for the same event handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question