Have a true/false check on user table highlight user if checked

Justin Dirks1
Tera Expert

Hello, 

 

I am having issues with creating a checkbox on the user table that will highlight the user whenever they submit a ticket/task.  I wanted this to work similar to VIP field.  

 

Any help on this would be amazing. 

 

Thanks!

14 REPLIES 14

Rohit  Singh
Mega Sage

Hi @Justin Dirks1 ,

 

What approach have you followed till now during which you are facing the issue?

Thank your following up, I have been using a client script for this using this code. 

function onChange(control, oldValue, newValue, isLoading) {
    var callerLabel = $('label.incident.caller_id');
    var callerField = $('sys_display.incident.caller_id');
    if (!callerLabel || !callerField)
        return;
   
    if (!newValue)

{         callerLabel.setStyle(\{backgroundImage: ""}
);
        callerField.setStyle({color: ""});
        return;
    }
    g_form.getReference('caller_id', vipCallerCallback);
}

function vipCallerCallback(caller) {
    var callerLabel = $('label.incident.u_monarch_vendor').down('label');
    var callerField = $('sys_display.incident.u_monarch_vendor');
    if (!callerLabel || !callerField)
        return;
   
    //check for VIP status
    if (caller.u_monarch_vendor == 'true')

{         var bgPosition = "95% 55%";         if (document.documentElement.getAttribute('data-doctype') == 'true')             bgPosition = "5% 45%";                     callerLabel.setStyle(\{backgroundImage: "url(images/icons/vip.gif)", backgroundRepeat: "no-repeat", backgroundPosition: bgPosition, paddingLeft: '30px' }
);
        callerField.setStyle({color: "red"});
    } else

{         callerLabel.setStyle(\{backgroundImage: ""}
);
        callerField.setStyle({color: ""});
    }
}

Shivalika
Mega Sage

Hello @Justin Dirks1 

 

Have you created the flagged field in user table already ? 

 

If not first create the flagged field, then setup a business rule to update this field value to true whenever the user created a ticket. 

 

Next for the user form - Create an onload Client script - that checks this flagged field using Get reference method in client script. If this is true you can dynamically change the label of the name field to show something else. 

 

If you also want to reflect it on list view you can configure style on the name field in user table. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Justin Dirks1
Tera Expert

Yes I have created the client script and the field.  The field is marked as u_monarch_vendor.

 

Thanks