SBL-DAT-00500 / SBL-EAI-04451: There were more rows than could be returned

SBL-DAT-00500 and SBL-EAI-04451: There were more rows than could be returned. Please refine your query to bring back fewer rows.

Reason:

By default any business component query with ForwardBackward mode can fetch up to 10000 records at a time. If any query (generated by eScript or Workflow or any other way) returns more than 10000 records, Siebel throws this error ‘There were more rows than could be returned.’

How to fix:

Below we have mentioned 3 solutions to fix this error. You could choose one as per your requirement.

Solution 1: Use ExecuteQuery with ForwardOnly mode

This is the best solution if it fulfills your requirement. Oracle also suggests not to use ‘ForwardBackward’ mode with ExecuteQuery if it is not absolutely required. Instead of ‘ForwardBackword’, use execute query with ‘ForwardOnly’ mode that does not limit on fetching records.

Solution 2: Refine query

If you have to use ‘ForwardBackward’ mode to meet the requirement, try to add few more conditions so that Siebel fetches less than 10000 records at a time.

If there is an absolute need of fetching more than 10000 records using ‘ForwardBackward’ query mode, then only go for solution 3.

Solution 3: Change ‘DSMaxFetchArraySize’ parameter value

DSMaxFetchArraySize is a subsystem parameter that determines the number of records a business component query with ‘ForwardBackword’ mode can fetch at a time. By default, DSMaxFetchArraySize has value ‘0’ that means business component can return only 10000 records in ForwardBackward query mode. It does not restrict the number of records in ForwardOnly execution mode. If you want to get all rows from ForwardBackward query, set DSMaxFetchArraySize parameter value as -1 (negative 1). But you do it only when you don’t have any workaround because setting DSMaxFetchArraySize to -1 has impact on application performance due to large memory use. Even Siebel Object Manager could crash because of memory exhaustion.

To change this parameter value, follow below steps:

  • Login into Siebel application as Administrator
  • Navigate to Administration-Server Configuration > Enterprises
  • Under ‘Profile Configuration’ tab, search for the profile ‘Server Datasource’
  • In the Profile Parameters list, click on ‘Advanced’ button to get all advanced profile parameters
  • Query on Alias field for DSMaxFetchArraySize and set the value to -1
  • Restart Siebel Server services

Beside ‘DSMaxFetchArraySize’, you check ‘Maximum Cursor Size’ property at Business Component level also. This property also restricts the number of records that Siebel CRM can fetch from server. If ‘Maximum Cursor Size’ property contains any value, it overrides MaxCursorSize parameter, defined in the configuration file. This parameter is applicable only on Oracle or DB2 database.

– Set ‘Maximum Cursor Size’ property value to -1 if you want records until Siebel encounters an end of file
– Set it to ‘0’ to get 10000 records
– If you set any number greater than 0, Siebel fetches that many number of records

Same as DSMaxFetchArraySize, this property also has performance impact. So before setting this property value to -1, check all other possibilities to avoid it.

If your Siebel application is using IBM DB2, then you need to check another two parameters – DSPreFetchSize and DSMaxCursorSize.

Do you have any question? Please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< The method IsPortableUIMode is not supported            Error has occurred executing a Sql >>

Debugging in Siebel Open UI (Siebel Open UI Training – Part 7)

Debugging in Siebel Open UI is the most important and difficult task for any Open UI developer, isn’t it!!

But don’t worry, after reading this article, it will be easier for you to debug script in Siebel Open UI. In Open UI, we write script mainly for Presentation Model, Physical Renderer and Theme. Here we will discuss step by step approach of debugging Siebel Open UI script.

We will use browser developer tool extensively to debug Open UI script. In our previous module on Siebel Open UI theme, you have seen how to use browser developer tool for development purpose. Here you will use the same tool for debugging.

So what is Browser Developer Tool ?

Browser developer tool is a vanilla tool provided by almost all modern browsers like Google Chrome, Mozilla Firefox, IE 8+. It gives an inspector to verify JS or CSS files are downloaded properly on the browser or not. It allows inline modification of HTML and CSS rules to see how changes affect look and feel of the webpage. You can also see variables values, set breakpoints in JavaScript code from developer tool.

To open browser developer tool, right click on any web page and then click on ‘Inspect Element’. You could use shortcut keys also like F12 for Google Chrome, Shift+Ctrl+Q for Mozilla Firefox.

Steps for debugging in Siebel Open UI:

  1. Verify JavaScript and CSS files are downloaded properly in the browser
  2. Verify Javascript Class is properly loaded
  3. Use SiebelJS.Log() function to log messages
  4. Use debugger statement to add breakpoints inside script

1. Verify JavaScript and CSS files are downloaded properly in the browser

If your code does not work, first step is to verify all files are downloaded properly in the browser. Best tool to do so is browser developer tool (Inspect Element). You first open Siebel Open UI application Debugging in Siebe Open UIand right click to choose ‘Inspect Element’ to open developer tool. If your browser is Google Chrome, then go to ‘Source’ tab and search for files.If there is any error or warning in downloading file, you will see a small red or yellow icon on the top right hand corner. You click on those icons and down the ‘Inspect Element’ window, another window will show all errors.

There may be several reasons behind download failure.

– JS file is not properly defined in Manifest Administration. To know more about Manifest Administration, read our article ‘Manifest File Customization

– Error in JS file itself

2. Verify JavaScript Class is properly loaded

To verify JavaScript Class is properly downloaded to the client, go to Inspector tab and type SiebelAppFacede.<First few letters of class name>JavaScript debugging in Siebel Open UI

– If class is properly loaded, auto complete feature of the console will recognize the class

– If browser does not suggest the class, then verify the class is properly registered in the namespace of JS file or not

3. Use SiebelJS.Log() function to log messages

Use SiebelJS.Log() to print variable values or any other log messages on inspector tab

– Use GetFieldValue() to get values of controls in the Presentation Model

Presentation Model Debugging

– Use val() to get values of elements in the Physical Renderer

Physical Renderer Debugging

– To see the output of log messages, open browser tool and go to Inspector tab

  • All log messages appear in execution order
  • If you have used log statement in multiple places, then add file name or any separator among log messages. It will help you to understand which log message is coming from which file.

4. Use debugger statement to add breakpoints inside script

– Almost all modern browsers have built-in breakpoints feature with developer tool. You could add expression on breakpoints also.

Siebel Open UI debugging

– If the developer tool does not give breakpoints functionality or you want to set breakpoints explicitly, then use ‘debugger’ statement in your script.

Debugging techniques in Siebel Open UI

– ‘debugger’ behaves the same way as breakpoints, code execution will stop at that point.

Few Recommendations :

– Use JavaScript code quality checking tools like JSHint, JSLint to verify JS file before deployment

– Remove debugger and SiebelJS.log() from script before moving to production

– Try to avoid alert() to print variable values

              ♦ While debugger and SiebelJS.log() are invisible to end users, alert() throws alert message to end users

– Test with all browser and device combinations before moving the script to production

Session Highlights – Debugging in Siebel Open UI:

1) Use browser developer tool to verify that the JS or CSS files have been downloaded properly

2) Use SiebelJS.Log() to print variable values or to decide that the code execution has reached certain point

3) Use debugger to add breakpoints

This ends our seventh Open UI training module – Debugging in Siebel Open UI.

To check your Siebel Open UI skill, click here – Siebel Open UI Quiz 

If you have any question about Siebel Open UI Debugging, please feel free to comment below.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Goolge+.

<< Module 6: Siebel Open UI Theme                             Module 8: Presentation Model Methods >>

Watch our YouTube Video on Debugging in Siebel Open UI:

How to display barcode on Oracle BI Publisher report

We all know use of barcode, right! It helps business to track a product or order quickly and accurately. Like in any supermarket, barcode helps to identify items easily and accurately. But how to generate barcode from Siebel or any other system? Can we generate and display barcode on Oracle Business Intelligence Publisher Report?
Answer is YES, we can use BI Publisher as barcode generator and print/display barcode on report.

Recently, I was working on a requirement for one manufacturing company where they were looking for better approach to track Service Request and RMA (Return Material Authorization) of products distributed among different systems. So easiest and reliable solution is Barcode but how will it help them to meet their goal? Well, let me give you a business scenario. Right now, business uses Siebel CRM application to create service request of any product or order. Suppose for RMA type service request, Siebel system will generate the RMA number and then send it to dispatch section for mail communication. So for dispatch section, it is manual task to enter RMA number into System. Next for RMA working department, it is another manual task to enter RMA number into their system. In complex system, business could have more hierarchy and more hierarchy means higher chance of doing wrong entry. So they need automation of this manual task to make the process faster and error free (almost error free) and best solution is barcode automation. Siebel will generate the RMA number and send it to reporting system (here business is using BI Publisher for reporting purpose). Then BI Publishers will change the RMA number to barcode which will be referred by all other business units. To read barcode, business units need only barcode scanner which will change the barcode to actual number and make an entry on their system. Faster and error free, isn’t it!!

Now, question is how BI Publisher will generate barcode and print it on report? 
Barcode is nothing but special kind of font which barcode scanner only can read. There are few free barcode fonts and few paid fonts. As per requirement, you could pick free font or paid. For our requirement, we have used free barcode font 39HIHR.ttf of barcode39 font family. In Microsoft Word, 39HIHR.ttf looks like below (barcode above and number down).
How to display barcode on Oracle BI Publisher report www.techonestop.com
You can download the font from Google. If the font file is zipped, then unzip it and paste it under C:WindowsFonts folder. Once you paste Code39.ttf, it will be installed automatically and you should see many other barcode fonts like 39HI.TTF, 39HIHR.TTF, 39HITLHR.TTF. To verify the new barcode font, open one word doc in MS word, write any text and select one barcode font. You will see the text in barcode font. Now our first step is completed. We have successfully installed barcode font on our system so that we could build our report template using barcode font. Here we have used 39HIHR.ttf as business needs barcode bar above and RMA number down what exactly this barcode font provides
.
Next check BI Publisher Desktop is installed on your system or not. We need it to build template with barcode font. If BI Publisher Desktop is installed, then you could see Oracle BI Publisher Add Ins tab in MS word. I hope you know how to add bookmark to display field in report. Here we have added two bookmarks, one for SR number and another for RMA Number and we have picked BC 39 HI HR font (which is nothing but display name of 39HIHR.ttf font) for both two fields.
display barcode on Oracle BI Publisher report www.techonestop.com
Once report template is ready, see the preview to check barcode font. To see preview, first add the font in xdo.cfg file, located under ..BI Publisher DesktopTemplate Builder for Wordconfig. If you are doing for first time, then you may have xdo_example.cfg instead of xdo.cfg. We have to rename this file as xdo.cfg and add below script under ‘<!– Font setting –>’ section.
<font family=”BC 39 HI HR” style=”normal” weight=”normal”>
<truetype path=”C:Program FilesJavajre6libfonts39HIHR.ttf” />
</font>
It should look like below
xdo.cfg www.techonestop.com
Now we can see the preview of the template. To see preview, click on Preview option from Oracle BIP Toolbar and select the report type (example PDF, DOC, HTML). If the template preview does not meet our requirement, modify it and verify it again. Once the template is ready, generate XLIFF file from the original template. At runtime, original template is applied for the layout and the XLIFF file is applied for translation.
Follow below steps to generate an XLIFF file from an RTF template
    – Open the template in Microsoft Word and click on Add-Ins tab
    – From the Template Builder menu, select Tools > Translate Template > Extract Text, BI Publisher 
      will extract the translatable strings from the template
    – Save the file with .xlf extension
Now our template and XLIFF file are ready. Next step is font mapping in BI Publisher so that we could use BIP as Barcode Generator. Follow below steps to configure new font in BIP.
Step 1:
Check the java path which is getting referred by Business Intelligence Publisher server and copy the font file (39HIHR.ttf) from C:WindowsFonts to .. Javajre(version no)libfonts
    – Make sure, font file extension (.ttf) is in small letter otherwise font may not appear in font mapping dropdown
    – If the extension is in Caps, then change it to small letter first and then copy it
    – Restart the werserver (OC4J/Tomcat) service if required

Step 2:
Login to BI Publisher Application and Navigate to Admin > Runtime Configuration > Font Mappings
Oracle BI Publisher font mapping www.techonestop.com
Step 3:
As per report template type (RTF or PDF), click on ‘Add Font Mapping’ button to add font. As we have used RTF template for our requirement, font mapping for RTF template type will be sufficient, no need to do anything on pdf font mapping option.
              Base font = BC 39 HI HR (Base Font value should be same as font display name in MS Word)
              Style = Normal
              Weight = Normal 
              Target Font Type = Truetype
              Target Font = Actual font file (39HIHR.ttf)
              TTC Number = (keep it blank)

Barcode font mapping on Oracle BI Publisher report www.techonestop.com

Step 4:
Click on ‘Apply’ button from right hand side top corner and restart the webserver (OC4j or tomcat) service.

That’s all. Now goto Siebel application, upload files (template file and XLIFF file) on Administration-BI Publisher and generate reports. You could see nice barcode on the template.

Few things to remember:
– Font file extension (.ttf) must be in small letters otherwise font may not appear in font mapping dropdown
– Sometimes barcode scanner needs barcode terminator to read the code properly, mainly if you are using code39 barcode font. Here we have used * (asterisk) as terminator.

If you have any doubt or question, feel free to ask us. To get more updates on recent activities, follow ‘TechOneStop’ on Facebook/Twitter/LinkedIn or join our website as followers. In our next article, we will discuss about how to display MICR code and QR code on BIP Report.

Watch our video as well: