function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Stephanie DormanStephanie Dorman 

Bypass Record Type When Creating Case from Live Agent

I am currently implementing a pre-chat screen for Live Agent. I want the prescreen to open the account based on screen name (which is working correctly) and then open a case - bypassing record type screen. (Which is not working, it always opens to the "select record type" for case.)

Below is the code. Help me stackexchange, you're my only hope. :-/
 
<!-- Map the detail inputs to the Account fields --> 
  <input type="hidden" name="liveagent.prechat.findorcreate.map:Account" value="FirstName,first-name;LastName,last-name;Screen_Name__c,screen-name;" />
 
<!-- Try to find the Account by screen name (exact match) -->
  <input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="Screen_Name__c,true;" />
  <input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="Screen_Name__c,true;" />
 
<!-- If the Account is not found, then create one with the following fields set -->
  <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Account" value="FirstName,true;LastName,true;Screen_Name__c,true;" />
 
<!-- Save the Account on the Live Chat Transcript's Account's Loookup -->
  <input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Account" value="Account" />
 
<!-- Show the Account when it is found or created -->
  <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Account" value="true" />
  
<!-- Create a Case every time -->
 <input type="hidden" name="liveagent.prechat:caseOrigin" value="Chat" />
  <input type="hidden" name="liveagent.prechat:caseRecordType" value="Incident" />
  <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Origin,caseOrigin;RecordType,caseRecordType;Subject,drop-down;Description,issue" />
  <input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Case" value="Origin,true;RecordType,true;Subject,true;Description,issue" />
  <input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Case" value="Case" />
  <input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Case" value="true" />

<!-- Link the Contact to the Case -->
  <input type= "hidden" name="liveagent.prechat.findorcreate.linkToEntity:Account" value="Case,AccountId" />

 
Parvinder SinghParvinder Singh
Change users profile and only enable one recordtype (which you want) for the profile, so if there will be only one recordtype enabled for the profile the user will skip the recordtype selection page. Not aware of any other way to achieve this.
Caitlin Tuba 3Caitlin Tuba 3
Probably a little late, but adding for anyone searching in the future.

You can set the RecordType in your calls when creating the Case
 
<script type='text/javascript'>
	//The hard coded e-mail address should be replaced by the e-mail attribute of the logged in User
	liveagent.addCustomDetail("Web Email", "test@gmail.com");
	liveagent.addCustomDetail("Subject", "Live Agent - test@gmail.com");
	
	//These should not be changed by Client
	liveagent.addCustomDetail("Case Record Type", "01231000001IeFi");
	liveagent.addCustomDetail("Case Origin", "Live Agent");
	/*
	This will create a Case.  No searches are being done.  
	When Salesforce inserts a Case with the SuppliedEmail populated Salesforce has been developed to search for a Contact or Lead with that e-mail address and attach it to the Case
	*/
	liveagent.findOrCreate("Case")
									.map("SuppliedEmail", "Web Email",false, false, true)
									.map("RecordType", "Case Record Type",false, false, true)
									.map("Subject", "Subject",false, false, true)
									.map("Origin", "Case Origin",false, false, true)
									.saveToTranscript('CaseId').showOnCreate();

	liveagent.init('https://d.la2w1cs.salesforceliveagent.com/chat', '57231000000NXLO', '00Dg0000006Hito');
</script>

 
JonDobbsJonDobbs
For anyone who came across this page and still couldn't get the case record type to be set, the field name is 'RecordTypeId' not 'RecordType'. The following works for me:
 
liveagent.addCustomDetail('Case Record Type','01224000000FGBt', false);

liveagent.findOrCreate("Case").map("RecordTypeId", "Case Record Type",false, false, true)