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
zen_njzen_nj 

web to case changes case record type to the default of our Default Case Owner

I was able to set up a web-to-case html page and have it generate a salesforce case. However, the problem I am having is that even though in the web-to-case html page, I am specifying the case record type of the case, when it gets generated into salesforce, it looks like it is changing that case record type to the default case record type specified in the profile of our "Default Case Owner" as specified in the Cases Support Settings.

 

Is there anyway to override this behavior or this shouldn't be happening at all and somehow in my web-to-case page I need to specify some keyword/syntax?

Best Answer chosen by Admin (Salesforce Developers) 
zen_njzen_nj

DOH!

 

I found out the problem. I re-read the notes to web-to-case set up and it mentioned that one of the things to do is in the Case Support Settings, to choose Record Type Setting to be either:

Keep the existing record type

or

Override the existing record type with the assignee's default record type.

 

So I took a look at it, and sure enough, the Record Type Setting was using the Override the existing record type with the assignee's default record type.

 

So that's what's been happening, and I guess this "support setting" behavior doesn't get trapped in the debug log output.

 

So once I changed the Record Type Setting to "Keep the existing record type", everything works fine now.

 

Boy do I feel silly, but not sure why the previous administrator would have opt to use the override selection in the 1st place.  Thx for your help on this.

All Answers

werewolfwerewolf
Does your default case owner have visibility to the record type you're trying to set the case to?
zen_njzen_nj
yes. The default case owner has access to all the case record types.
werewolfwerewolf
How are you setting the record type in your W2C page?  Perhaps you're doing that wrong, and because it can't identify the record type it's using the default.
zen_njzen_nj

I don't think that's it because when I look at the Case History, it would show that the case was created first with case record type of ABC (where ABC was what I had defined in the web-to-case html page), but then it looks like workflow (or case assignment or something) then changed the case record type to the default case record type.

Below is cut/paste from case history:

 

Going from bottom up, it looks like it does the following:

 

1. creates the case

2. change account name to  XXX Helpdesk Temp Account * not sure how it's doing this either

3. changed case origin to Web  (I think this is from the web-to-case html page setting)

4. the owner of this web-to-case was originally XXX Salesforce Ticketing System  *and this is what was set up as the default case owner *

5.  The case record type initially of this web-to-case was IT Support, and it looks like it got changed to SF Admin * which is the default record type for XXX Salesforce Ticketing System user.  And we have workflow in place so that whenever a case record type is sfadmin record type, we would change the case owner to SF Admin queue.

 

So looking at this case history, it looks like initially a case is created with case record type of ITSupport and default case owner is XXX Salesforce Ticketing User. But because the default Case Owner has a default case record type of SFAdmin, it then changes the case record type from ITSupport to SFAdmin, and this in turns trigger our workflow to change case ownership to SF Admin Queue.

 

 

 

 

 

2/2/2009 2:42 PMXXX Salesforce Ticketing System 
  Changed Case Record Type from IT Support to SF Admin.
  Changed Owner (Assignment) from XXX Salesforce Ticketing System to SF Admin Queue.
  Changed Case Origin to Web.
  Changed Account Name to XXX Helpdesk Temp Account.
  Created.

 

werewolfwerewolf

The case history isn't telling you that much.

 

The account is set based on the email address that the person inputs on the W2C form.

 

As I asked earlier:

 

In the HTML, how are you trying to set the case history?

 

If that's correct, then you probably have a workflow or an Apex trigger that's setting the record type.  If that's the case then turn on the Debug Log for the W2C default user and see what it shows when a case gets created -- that'll help you track down the errant workflow.

zen_njzen_nj

in the web-to-case html page, I havein the very beginning this section of code:

 

<FORM name="request" action="https://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8" method="POST" onsubmit="return form_validation()">

<input type=hidden name="orgid" value="00D00000000hgZq">
<input type=hidden name="retURL" value="http://">
<input type="hidden" name="recordType" id="recordType" value="0120000000007gq">

 

 At one point  I also had in the middle/ending section where I am listing out the various field name/id and possible values this:

 

	<TR>  
<TD width=33%><label for="recordType">Case Record Type</label>
</TD>
<TD width=33%><select id="recordType" name="recordType">
<option value="0120000000007gq">IT Support</option>
 		</TD>  
<TD width=33%>
</TD>
</TR>
<TR>

 

 

But that didn't seem to do any good so I've taken that out and just left the beginning section in.

 

Thx for the pointer about using the debugger log. I did use that but it doesn't show how the Case Record Type is changed from IT Support to SF Admin - which the Case History shows:

 


 Changed Case Record Type from IT Support to SF Admin.
  Changed Case Origin to Web.
  Changed Account Name to NYFIX Helpdesk Temp Account.
  Created.

 

 

zen_njzen_nj

DOH!

 

I found out the problem. I re-read the notes to web-to-case set up and it mentioned that one of the things to do is in the Case Support Settings, to choose Record Type Setting to be either:

Keep the existing record type

or

Override the existing record type with the assignee's default record type.

 

So I took a look at it, and sure enough, the Record Type Setting was using the Override the existing record type with the assignee's default record type.

 

So that's what's been happening, and I guess this "support setting" behavior doesn't get trapped in the debug log output.

 

So once I changed the Record Type Setting to "Keep the existing record type", everything works fine now.

 

Boy do I feel silly, but not sure why the previous administrator would have opt to use the override selection in the 1st place.  Thx for your help on this.

This was selected as the best answer