Monday, Nov. 24, 2014

Use of indexOf() to restrict number of records in List applet

Written By:

|

July 31, 2012

|

Posted In:

Requirement:

The requirement is to show only top 10 records in a particular List applet.

Solution:

This requirement can be implemented using the below steps using indexOf() function.

1. You can limit the number of rows to 10 records on the List applet by setting the applet property called as “HTML Number Of Rows“.

Query your applet name in the Siebel Tools and modify the applet property called “HTML Number Of Rows” to 10.

2. Trick to implement the restriction using indexOf() is below:

Go to your applet and write the below line of code in the Server Script :

function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
if (MethodName.indexOf(“GotoNext”) >= 0 )
{
CanInvoke = “False”;
return(CancelOperation);
}
return (ContinueOperation);
}

3. Compile the applet and see the results.

Happy Learning!!



Share This Article

About Author

Gurdeep