September 02, 2005
HTMLDB Tabular Form Validation
Q: I have created a master/detail form and a tabular form by using the wizard. How can I add validations? Is it possible to reference the different values?
A: Response by Indrek Sooneste at HTMLDB forum
There are some tricks that can be used to validate detail form. At first take a look to your detail form, it is just a report. And updates are made using values in HTMLDB_APPLICATION.G_Fxx (where xx some number start at 01).
Example:
I made a master/detail form on demo_order and demo_order_items tables.
The select behind in detail form is
select "ORDER_ITEM_ID",
"ORDER_ID",
"PRODUCT_ID",
"UNIT_PRICE",
"QUANTITY"
from "#OWNER#"."DEMO_ORDER_ITEMS"
where "ORDER_ID" = :P5_ORDER_ID
So I created page level validation that checks if unit_price is empty and returns error message.
begin
FOR i IN 1.. HTMLDB_APPLICATION.G_F05.COUNT LOOP
if HTMLDB_APPLICATION.G_F05(i) is null then
return 'Unit Price cann''t be empti';
end if;
END LOOP;
return null;
end;
To figure out what is the right number for G_Fxx check the HTML source. The error message is displayed inline in notification.
When you want to show error message inline with filed then you have to rebuild your detail form and use collections.
Posted by rimblas at 07:29 AM | Comments (0)
August 29, 2005
Printing Barcodes from Oracle Apps
Printing barcodes has always been a challenge from within Oracle Application, specially when printing ASCII only reports.
FOOBAR is a filter style program that generates 3 of 9 barcodes via PCL codes. (FOOBAR was originally developed by Allen-Sauber Consulting.)
Configuration and Setup
You'll need to compile the foobar.c file. Place it on the path so that it's available to Oracle Apps.Setup a Driver with the following string as Argument (notice the use of the foobar executable as a filter):
cat $PROFILES$.FILENAME | foobar | lp -d$PROFILES$.PRINTER -n$PROFILES$.CONC_COPIES -t"$PROFILES$.TITLE"
Usage
Foobar works by recognizing a stream indicator and making a substitution with the PCL codes that represent the barcode.This is the form of the stream:
[FOOBAR;DATA=*BARCODE*]
Where BARCODE is the data to represent as a barcode. Note that the valid values are upper case letters and numbers.
Optionally you can have a HEIGHT parameter to specify the height of the barcode:
[FOOBAR;HEIGHT=77;DATA=*BARCODE*]
Posted by rimblas at 10:56 AM | Comments (0)
April 22, 2002
Using Oracle Web Applications, mod_plsql
Oracle Application Servers in conjunction with an Oracle Database have a very cool feature that has changed names multiple times: PL/SQL Cartridge, Oracle Web Applications, mod_plsql, etc.. However the concept remains the same: the ability to run native PL/SQL packages or procedure from a URL whose possible output is directed back to the browser to render an actual web page (or any MIME type output you desire)
This is my reference page that I used to host on my personal Twiki: Oracle Web Applications
You'll find quite a few code examples that without much effort can be ran anywhere.
Posted by rimblas at 04:09 PM | Comments (0)