Assigning the variables in variable sets in a record producer ti incident caller ID

Abishek1998
Tera Contributor

So,

My requirement is there is an check box called is it requested by someone. When this is selected another requested for field will appear. So the user entered in this requested for should be the caller in Incident. I have provided the existing code below.

current.description = producer.Please_describe_your_issue;
current.description += "\n\nComputer: " + producer.computer;
current.description += "\n\nPickup Location: " + producer.pickup_location;
if(JSUtil.notNil(producer.logged_in_user))
    {
        current.caller_id = producer.logged_in_user;
        current.contact_type = 'mobito';
    }
else
    {
        current.caller_id = gs.getUserID();
        current.contact_type = 'self-service';
    }
 

 

3 REPLIES 3

Murthy Ch
Giga Sage

@Abishek1998 

Can you try this:

if(!gs.nil(producer.logged_in_user))
    {
        current.caller_id = producer.logged_in_user;
        current.contact_type = 'mobito';
    }
else
    {
        current.caller_id = gs.getUserID();
        current.contact_type = 'self-service';
    }

Hope it helps:)

 

Thanks,
Murthy

No,

these are pre existing fields. I need to check whether the variables on the item is ticked. And it gets checked, the requested for field should be populated in caller area. How do i do this? I have not added the variables names in the above script

 

 

Try this now:

current.description = producer.Please_describe_your_issue;
current.description += "\n\nComputer: " + producer.computer;
current.description += "\n\nPickup Location: " + producer.pickup_location;
if (JSUtil.notNil(producer.logged_in_user)) {
    current.caller_id = producer.logged_in_user;
    current.contact_type = 'mobito';
} else if (producer.requested_by_someone == "true") { //replace with your actual name
    current.caller_id = producer.requested_for; // give the actual another requested for variable name
} else {
    current.caller_id = gs.getUserID();
    current.contact_type = 'self-service';
}

lmk if you still stuck

Thanks,
Murthy