Change field attributes

In this example, attributes of field on form OE10.3 are changed: A derived field is made visible and required.

function FORM_OnBeforeTransaction(fc) 
{ 
    // check the function code to limit code to an ADD 
    return (fc === "A" ? reqCODE() : true); 
} 
 
function reqCODE() 
{ 
    // check to see if the Activity field is populated 
    const act = lawForm.getDataValueById("text22"); 
    const message = "You Must Enter An Activity"; 
    if (act !== "") 
    { 
        return true; 
    } 
 
    // position cursor in required code field 
    lawForm.positionInFieldById("text22"); 
    lawForm.setMessage(message); 
    return false; 
}