How to set a mandatory item

Hello, please advise how to set a mandatory item based on different values entered in another item.
I tried this v části Před uložením:

if (doo.model.aktualniStav.value === ‘Vyzvednuto z PS’ || doo.model.aktualniStav.value === ‘Přijato na pobočce PNS’){
doo.model.vyzvednutyPlatebniTerminal.isRequired;
}

but the item hasn’t been set as mandatory. Thank you in advance for your advice.

Milan

Hi Milan,

to make the script work properly just add after isRequired = true;

if (doo.model.currentState.value === ‘Picked up from PS’ || doo.model.currentState.value === ‘Received at PNS branch’){
doo.model.collectedPaymentTerminal.isRequired = true;
};

With Regards,

Filip

:+1: Thanks, Filip

Milan