Change channel based on selected user in an onchange Workflow script ?

SUGGESTED

Hi all,

I've read as much as possible in the forum and find it strange that no one ever asked for that exactly...

During Case creation, which runs under an enabled new Case Workflow rule, I want that the Channel field is dynamically changed when the user changes the assigned user.

I supposed basically that I would solve this easily with :

1) a Create Script that sets the case_assigneduserid "Defaultvalue=CurrentUser.user_userid;"

2)an OnChange Script on the case_assigneduserid to change the case_channelid, but then I find it impossible to do that easily as I am here stuck at a client side level.

var AssignedUserID = crm.fields("case_assigneduserid").value(); //this is quite easy to retrieve the assigned user id.

But what about finding the Channel Id of this AssignedUserId ?

How can I do that within the scope of the new Case Workflow rule ?

Any help would be appreciated...

Parents Reply Children
  • 0 in reply to PPI-VDM
    SUGGESTED

    You could then do it as a SQL trigger on Cases and compare 'Inserted' to 'Deleted' thus if the Channelid is the same in both then you can overrule it with the primary team of the assigned user, if they're different then you just keep with the value being entered via the Insert (just need something else in there to stop a general update to Cases triggering a change to Channelid, some flag field that is written to if driven by the workflow or something)