Example
|
---|
Note: Code must be specified without opening and closing tags (
<? , ?> ).Important! It's not recommended to use the expressions type
{=...} inside the code body. They can contain parameters that can be modified by any account user even without necessary access permissions.
For example, it's better to use $root->GetVariable('COMPANY_NAME') instead of {=Variable:COMPANY_NAME} .1. Setting variable value
where: Variable1 - variable ID, with assigned value (number 12345).
2. Writing several users into "User" variable type
where: array("user_1", "user_2") - array with users in format user_[user_ID_in_system] .
3. Using PHP code and fields/variable values for getting iblock element name $arFilter = Array("IBLOCK_ID" => {=Variable:Variable1_printable}, "ID" => {=Document:PROPERTY_1}); $dc = CIBlockElement::GetList(array(), $arFilter, array("NAME")); $br = $dc->Fetch(); $Pbrr = $br["NAME"]; $this -> SetVariable('Variable2', $Pbrr); where: {=Variable:Variable1_printable} - variable value, containing iblock ID;
{=Document:PROPERTY_1} - element field, containing iblock element ID;;
Variable2 - variable ID, containing the calculated the iblock element name.
4. Converting element field format and further use Example of converting User element field into a clear format to use it when sending a message:
|
Views: 6557
Last Modified: 13.10.2021
Last Modified: 13.10.2021