E
E
Evgeny Moshkin2018-07-22 00:06:32
1C-Bitrix
Evgeny Moshkin, 2018-07-22 00:06:32

Why does the script for changing the infoblock element property not work?

CModule::IncludeModule("iblock");

$arSelect = Array();
$arFilter = Array("IBLOCK_ID"=> 25);

$res = CIBlockElement::GetList(Array(),
 $arFilter, false, Array("nPageSize"=>50), $arSelect);

while($ob = $res->GetNextElement())
{
 $arFields = $ob->GetFields();
  if(empty($arFields["CODE"])){
        CIBlockElement::SetPropertyValues($arFields['ID'], $arFields['IBLOCK_ID'], array('CODE' => 'WORKS!'));
    }
}

Bitrix is ​​such a Bitrix, the simplest script for installing a symbolic code if it is not installed. Doesn't work, can you tell me what I'm doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-07-23
@idruweb

Character code changes via Update

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question