Why doesn't the script change the properties of an element of the information block?

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 Bitrix is such that the simple script for installing the character code if it is not installed. Doesn't work tell me what am I doing wrong?
June 3rd 19 at 18:53
1 answer
June 3rd 19 at 18:55
The character code is changed via Update

Find more questions by tags 1C-Bitrix