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
StaciStaci 

Object doesn't support this property or method

I have 1 user in a profile that when they click our Take Case button they receive the following error:
A problem with the OnClick JavaScript for this button or link was encountered:
Object doesn't support this property or method.

I have had all other users within that profile try to click the button within IE and Chrome and none of them get this error.  Just this one user.  Any ideas?

Here's the code:

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")} 

var caseObj = new sforce.SObject("Case"); 

caseObj.Id = '{!Case.Id}'; 
caseObj.OwnerId = '{!$User.Id}'; 
caseObj.Status = 'In Progress'; 

var roleName = '{!$UserRole.Name}'; 
if((roleName.indexOf("Tier 3") != -1) || (roleName.indexOf("Field Operation") != -1) || (roleName.indexOf("Service Engineer") != -1)) 
{ 
caseObj.Substatus__c = 'Open with Product Specialists'; 
} 
else 
{ 
caseObj.Substatus__c = 'Open with Support Advocates'; 
} 

if('{!Case.Incident_First_Response__c}'=='') 
{ 
caseObj.Incident_First_Response__c=new Date().toISOString(); 
} 

var result = sforce.connection.update([caseObj]); 

if (result[0].success=='false') { 
alert(result[0].errors.message); 
} else { 
window.parent.location.href="/{!Case.Id}"; 
}

 

 

pjcloudpjcloud

First thing, have you been able to deduce which field is actually throwing the error? Presumably it is Incident_First_Response__c. 

 

Next question is are you using permission sets. It is possible the access is granted using permission sets, not directly by the profile. Having other users clicking on the button is a good first step to troubleshoot, but have you actually looked at the profile in question to see if the Field Level Security is granted there? 

AsiereikiAsiereiki

Learn to use the debug and your life will be easier.

 

With Chrome you can open the javascript console with Control+Shift+I . Click the button and check the line where the bug is.

 

Another way is typing debug()  in the javascript code, so, whit the console opened, the execution will stop there.