crmTech/ July 13, 2012/ Siebel/ 0 comments

If we are using Edit List applet and configured Custom button on it then sometimes it needs to disable/hide on Query applet.
If it is not happening using any User Property then needs to write a Server/browser script on Applet.

Server Script
Note: Most of the times Server script is not working so need to write a Browser Script. Please refer Browser script section for it.

function WebApplet_PreInvokeMethod (MethodName)
 {
 switch(MethodName)
 {
 case "NewQuery": //This is called when the query mode is invoked
 TheApplication().SetProfileAttr("CurrentAppletMode","QUERY");
 break;
 case "RefineQuery": //This is called when the query mode is invoked by CTR+R
 TheApplication().SetProfileAttr("CurrentAppletMode","QUERY");
 break;
 case "UndoQuery": // when these invoked applet leaves query mode
 case "ExecuteQuery":
 TheApplication().SetProfileAttr("CurrentAppletMode","NOTQUERY");
 break;
 case "LPMSubmitButton":
 fnCreateNotification();
 sReturn = CancelOperation;
 break;
 default:
 break;
 }

Browser Script: Most of the times Server script is not working so need to write a Browser Script.

Approach 1:

function Applet_InvokeMethod (name, inputPropSet)
 {
 switch(name)
 {
 case "NewQuery": //This is called when the query mode is invoked
 theApplication().SetProfileAttr("CurrentAppletMode","QUERY");
 break;
 case "RefineQuery": //This is called when the query mode is invoked by CTR+R
 theApplication().SetProfileAttr("CurrentAppletMode","QUERY");
 break;
 case "UndoQuery": // when these invokde applet leaves query mode
 case "ExecuteQuery":
 theApplication().SetProfileAttr("CurrentAppletMode","NOTQUERY");
 break;
 default:
 break;
 }
 }

Approach 2: If Approach 1 is not work then we don’t have an option to hide a control on Query applet.
Note: This browser script sometimes not work if Applet has a record.

function Applet_InvokeMethod (name, inputPropSet)
 {
 if (name == "NewQuery")
 {
 var controlVar = this.FindControl("Assign To Me");
 controlVar.SetProperty("Visible", "false");
 }
 else
 {
 var controlVar = this.FindControl("Assign To Me");
 controlVar.SetProperty("Visible", "true");
 }
 }

Approach 3: Combination of Applet Load and Applet PreInvoke event to enable and disable custom button.

Applet Load Event:

function Applet_Load ()
 {
 try
 {
 sNewApplet = theApplication().FindApplet("Order Entry List Applet");
//enabling View/Modify button
 sActXCtrlViewModify = sNewApplet.FindActiveXControl("EditRecord");
 sActXCtrlViewModify.style.visibility = "";
}//end try

Applet PreInvoke Event

function Applet_PreInvokeMethod (name, inputPropSet)
 {
 switch(name)
 {
 case "NewQuery":
 case "RefineQuery":
//hidding View/Modify button
 sActXCtrlViewModify = sNewApplet.FindActiveXControl("EditRecord");
 sActXCtrlViewModify.style.visibility = "hidden";
break;
case "ExecuteQuery":
 case "UndoQuery":
//enabling View/Modify button
 sActXCtrlViewModify = sNewApplet.FindActiveXControl("EditRecord");
 sActXCtrlViewModify.style.visibility = "";
break;
 default:
 break;
 }
 }
Advertisements
Share this Post

About crmTech

Sharad is working from more than 11 years in IT industry. He has giving his technical services in CRM for telecom, automobile, retail, finance industry in Sales, Service and Marketing. He has primary skill in Siebel and Salesforce Marketing Cloud. Apart from this he has worked in Google Cloud, Wordpress blogging, SEO optimization, Short film making, mobile apps creation,logo design creation for his own interest.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.