Answer the question
In order to leave comments, you need to log in
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!'));
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question