2. Create the Control User Properties for the inputs to the ShowPopup method.
Name: Popup Value: (Popup Applet Name)
3. Create a new popup applet. I am not going into details of the popup applet. Its same as any other applet. Just keep in mind to have the class as "CSSSWEFramePopup" and the Height and Width as per your requirement. Also this popup applet must contain only those fields that are required for the interface call.
4. Now write a script to make the Interface Call button enabled i.e. CanInvoke to "True" in the parent applet.
WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if(MethodName == "ShowPopup")
{
CanInvoke = "TRUE";
return (CancelOperation);
}
return (ContinueOperation);
}
5. Now the meat of the design. Write a code in the preinvoke method of the parent applet to check if the required fields for Interface call are available or not.
function WebApplet_PreInvokeMethod (MethodName)
{
if(MethodName == "ShowPopup")
{
var lFieldVal = this.BusComp().GetFieldValue("Some Field");
if (lFieldVal != null && lFieldVal != "")
{
CallInterface();
return (CancelOperation);
}
}
return (ContinueOperation);
}
What happens in the above code is, it checks for the field value and if the value is populated then it calls the interface function and does a canceloperation. This will not invoke the popup applet as the operation is cancelled. Whereas if the field doesnt have a value then it will continue with the normal Siebel operation and show the popup window.
6. The last step is some configuration and few lines of script in the popup applet. Add a control in the Popup Applet with the name "Ok' and method "CloseApplet". This button is to close the applet.
Finally add the following code in the invoke method of the popup applet.
function WebApplet_InvokeMethod (MethodName)
{
if(MethodName == "CloseApplet")
{
var lFieldVal = this.BusComp().GetFieldValue("Some Field");
if (lFieldVal != null && lFieldVal != "")
{
CallInterface();
}
else
{
TheApplication().RaiseError("This field is required");
}
}
}
Note: In this requirement the popup applet and parent applet are based on the same BC. You can experiment with other BC's as well like if we have the child BC fields required.
Compile both the applets and Voila you would have Zapped your Siebel!!!
No comments:
Post a Comment