Help! I am getting a [SafeCall Exception] error message on the screen after creating a new opportunity.
This is the error that I am getting.
[SafeCall Exception]: SQL Error
oppo_dummy jscript error: [SafeCall Exception]: SQL Error Line: 38 Char: 0
[SafeCall Exception]: SQL Error
oppo_dummy jscript error: [SafeCall Exception]: SQL Error Line: 38 Char: 0
I am using the oppo_dummy field to add a new panel to the Opportunity summary screen. I have used the following post to assist me with getting the panel on the screen. https://community.sagecrm.com/partner_community/b/hints_tips_and_tricks/archive/2016/11/02/adding-a-new-panel-to-a-summary-screen-e-g-company-summary.aspx
The panel does not display during the insert of the opportunity. However, I need it to display immediately after the opportunity is inserted.
The opportunity gets created and the panel displays on the screen and appears as expected (ie everything "looks" good). However, I also get the SafeCall Error message displayed on the screen and I cannot determine why. I have reviewed the logs and they are not indicating an error.
The error appears to be repeated twice (on the screen). Below is the code that I have in the oppo_dummy field. I have compacted the lines to save space. Line 38 is actually a blank line right after the following line of code -- else if (OppoType == "Acquisition")
Where might I have gone wrong with the below code? Any assistance would be greatly appreciated! Thank you!
if (Values("Act") == 260 || Values("Act") == 520 || Values("Act") == 1190 && Values("Mode") == 3)
{
var OppoID = CRM.GetContextInfo("Opportunity", "oppo_opportunityid");
var OppoRecord = CRM.FindRecord("Opportunity","oppo_opportunityid=" + OppoID);
var OppoType = Values("oppo_opportunitytype");
if (OppoType == "Service"){
var NewDetailsPanel = CRM.GetBlock("OppoDetailsService");
}
else if (OppoType == "PortfolioLeasing")
{
var NewDetailsPanel = CRM.GetBlock("OppoDetailsLeasing");
}
else if (OppoType == "Acquisition")
{
var NewDetailsPanel = CRM.GetBlock("OppoDetailsAcquisition");
}
NewDetailsPanel.DisplayButton("1") = false;
NewDetailsPanel.DisplayForm = false;
var strBlockHTML = NewDetailsPanel.Execute(OppoRecord);
Caption = "<script" + ">";
Caption += "var strPanelHTML ='";
Caption += strBlockHTML;
Caption += "';";
Caption += "<" + "/script>";
}
else {
Hidden = true;
}