+ Start a Discussion
Jerun JoseJerun Jose 

Javascript button issue - Service Cloud Console

Hi,

 

We have a simple custom button that executes an on-click Javascript code.

 

var openSubtab = function openSubtab(result) {
	targetURL='/_ui/core/email/author/EmailAuthor?isdtp=vw';
	javascript:sforce.console.openSubtab(result.id,targetURL, true, 'Send Email');
};

var callOpenSubtab = function callOpenSubtab(result){
	sforce.console.getEnclosingPrimaryTabId(openSubtab);
};
sforce.console.getEnclosingPrimaryTabId(callOpenSubtab);

 This code works on normal execution. However, if I delete a related record for a case and then click this button, I get the error 'Registry is undefined'.

 

Anybody who can explain or help me understand this??