O
O
Oleg Kolesnikov2021-07-12 13:49:28
1C-Bitrix
Oleg Kolesnikov, 2021-07-12 13:49:28

How to prohibit changing the values ​​of infoblock properties in 1C Bitrix BUS?

Good afternoon!
There is a base in 1C UT and there is a site on BUS Small business.
Added the init.php file to handle the incoming directory, namely not to overwrite some values ​​in the infoblocks when importing, like this:

AddEventHandler("iblock", "OnBeforeIBlockPropertyUpdate","DoNotUpdate");
AddEventHandler("iblock", "OnBeforeIBlockSectionUpdate", "DoNotUpdateSection");
function DoNotUpdate(&$arFields){
    if (@$_REQUEST['mode']=='import')
    {
        unset($arFields['NAME']);
    }
}
function DoNotUpdateSection(&$arFields){
    if (@$_REQUEST['mode']=='import')
    {
        unset($arFields['NAME']);
    unset($arFields['CODE']);
    }
}

But there was a need not to rewrite not only the names of the properties, but also the values, the values ​​in the form of lists. I make a log, I see this: I
60ec1c6da0370938788243.jpeg
try by analogy unset($arFields['VALUES']); - it doesn't work, I
try to enumerate the VALUES array and apply unset to each VALUE - it doesn't work,
I watch the following event: OnIBlockElementSetPropertyValuesEx Am
I looking there...??

Essence of the question: it is necessary that when importing from 1C, the property values ​​in the infoblock are not overwritten, below is the picture
I would be grateful for your help!
60ec1daa3affe485563335.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Kolesnikov, 2021-07-21
@Twstd

If someone is interested in the solution, then there is no built-in solution. I solved the problem through another event
AddEventHandler('catalog', 'OnSuccessCatalogImport1C', 'customCatalogImportStep');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question