Cases : Linking Team to Assigned User

Hi,

I'd like to link the Team (case_channelid) field with the value of the field Assigned To (case_assigneduserid) in my Case Status screen (CaseStatusBox).

For instance if I select User A I want to automatically modify the value of the Team field to its PrimaryTeam "dynamically" (not after the click on save button, ie not with a Validate script if possible)

I've tried to add this on the Assigned To field in the OnChangeScript box but it doesn't work :

var userID = case_assigneduserid;
var user=CRM.FindRecord('users','user_userid=+userID);
if (!user.eof)
{
case_channelid=user.user_primarychannelid;
}

Please help or give advice on how to implement this !

Thank you

Valerian

  • 0

    Hi Proconsult,

    You can try with the following logic. Please refer below steps.

    1) Create array for fields User Id and Channel id i.e. (team) on “Assigned to” create script. Store your all values in it.
    2) Create a JavaScript function which will give you current user id and Channel id based on OnChange event of Assigned To field.
    3) Now pass these values in array stored by you on create script of “Assigned to”.
    4) Call this function on “OnChangeScript” of Assigned To field in CRM.

    Hope this helps!

    Regards,
    Dinesh