1

the field Origin already exists and is a picklist with Chat as one of the options

  • 1
    could you add some details to where and how you're trying to do this ? – Samuel De Rycke Feb 11 '14 at 23:11
2

Set the detail as a hidden input:

<input type="hidden" name="liveagent.prechat:caseOrigin" value="Chat" />

Map it:

<input type="hidden" 
       name="liveagent.prechat.findorcreate.map:Case"   
       value="Origin,caseOrigin;" />

Specify that you want it created:

<input type="hidden" 
       name="liveagent.prechat.findorcreate.map.doCreate:Case" 
       value="Origin,true;" />

If you want to show the Case when it is created make sure you set that as well:

<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />

Note that if you are mapping multiple fields, the map and create inputs take a semi-colon separated list. For example, if you were mapping a caseSubject detail in addition to your caseOrigin detail, you'd have something like the following:

<input type="hidden" name="liveagent.prechat.findorcreate.map:Case" 
       value="Origin,caseOrigin;Subject,caseSubject;" />

<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" 
       value="Origin,true;Subject,true;" />


There isn't a ton of information out there on the Live Agent Pre-Chat API and Pre-Chat form, yet, as it is still relatively new. I recently wrote a very detailed article about the live agent pre-chat API.

| improve this answer | |
1

Well depending on what your code looks like (I am assuming it is a custom vf page with a class?) When saving the record you simply set the field to that value.. Here is what it would look like in one form or another..

Case c = new Case(Origin = 'Chat');
insert c;

or

Case c = new Case(); 
c.Origin = 'Chat';
insert c;

or to get a bit more detailed..

public Case cseObj {get; set;}

public PageReference saveCase() {
  cseObj.Origin = 'Chat';
  insert cseObj;
}

but again this all depends on how you are doing it, so more information would be nice.. I am also positive you could do this with some kind of workflow etc, but this is the code way :-) or at least some of the ways to accomplish it via code.. If you are using a Standard Controller for Case it is a bit different, but not by much..

| improve this answer | |
  • 1
    The case doesn't get created from a controller in live agent. – PepeFloyd Feb 12 '14 at 16:57
  • well at the time it wasn't clear what he wanted, so I didn't know he was talking about 'live agent' – SalesForceGirl Feb 18 '14 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.