How to display company name that an operator belongs to?

Hi, All

 

I would like to know the way how to display the company that an operator belongs to.

I guess I need to use a link and query, but I do not know how.

 

For example, an operatorA belongs to company A, operator B to company B.

When an operator A login, company A will being displayed as the default company that the operator A works for.

Likewise, when an operator B login, it shows company B. 

 

I am using SM9.40

 

Regards,

 

Shuta

  • If multi-company mode is enabled in the System Information Record, login.DEFAULT format control automatically populates $lo.company with the default company value from the user's operator record at login. If you want this to take place without enabling multi-company, you could update the condition for the calculation to remove the check for $G.multi.

     

    If you instead want to populate a company variable based on the user contact record, you could set a variable in login.DEFAULT referencing company in $file1 (on the queries tab, the contacts table is the first file query and retrieves the operator's contact record):

    $lo.contact.company = company in $file1

     

    You can use variable as the input for a caption if you just want to display it, or use it in FC calculations to set a field value.

  • I got a same requirement and tried in many ways but this worked for me

     

    Format control-->table name(may be incident or probsummary)

    javascript-->

    fill Add:- true, display:- true, initial:-true

     

    var contact = new SCFile("contacts")

    var findcontact = contact.doSelect("operator.id=\"" system.record.contact_name "\"")

    if ( findcontact == RC_SUCCESS )
    {

    system.record.company=contact.company;

    }