Passing values to a LINKSCREEN in PH Web

Edis, Bob bob.edis@fleetpride.com
Thu, 28 Jun 2001 18:32:10 -0500


G'day all, again

Ok, so now my JavaScript is 'maybe' resolved.  What I'm trying to do is call
one screen from another like so.

Screen A.
User enters a customer id, finds related records in results list and data is
loaded for selected record (happens to be a cheque).
User enters an invoice number (temp item) on screen and clicks link to
subscreen (screen B) to see invoice detail (actually could be several
records as invoice number is not unique).  There user selects invoice record
and is taken to a posting screen to apply part or all of the cheque value to
the selected invoice (screen C).

In screen A the logic is:

QKS
...
TEMP t_invoice_nbr     VARCHAR*15 RESET AT STARTUP
TEMP t_invoice         CHAR*01 INIT "Y"
...
FIELD t_invoice_nbr LABEL "Invoice #:"  &
  LOOKUP ON post_invoice                &
  MESSAGE "*E* Invoice not found!"
FIELD t_invoice        NOLABEL
...
LINKSCREEN pc_select_invoice LABEL "Select Invoices"                &
           ACTION "SEARCH"                                          &
           PASSING corp_cust_id     AS "POST_INVOICE:corp_cust_id", &
                   t_invoice_nbr    AS "POST_INVOICE:invoice_nbr",  &
                   check_nbr        AS "t_check_nbr",               &
                   check_date       AS "t_check_date",              &
                   amount           AS "t_check_amount",            &
                   amount_applied   AS "t_amount_applied",          &
                   amount_open      AS "t_amount_open",             &
                   t_invoice_status AS "t_invoice_status",          &
                   check_key        AS "t_check_key",               &
                   t_invoice,                                       &
                   t_sort_inv_nbr

HTML
<input type="hidden" size="1"  name="T_INVOICE"
value="<!--PH:VALUE:T_INVOICE-->">
...
<table width="60%" cellpadding="0" cellspacing="0" frame="void">
<tr>
<td align="right">
<B><I>Invoice Number&nbsp;</i></b>
</td>
<td width="18">
<input type="text" size="14" name="t_invoice_nbr"
value="<!--PH:VALUE:t_invoice_nbr-->">
</td>
<td align="left">
<A
HREF="/cgi-bin/phcgi.exe?PH_QKC=pc_select_invoice&amp;PH_APP=CORPCUST_APP&am
p;PH_HTML=pc_select_invoice.htm&amp;PH_ACTION=Search&amp;POST_INVOICE:corp_c
ust_id=<!--PH:LINKVALUE:POST_CHECK:corp_cust_id-->&amp;POST_INVOICE:invoice_
nbr=<!--PH:LINKVALUE:T_INVOICE_NBR-->&amp;t_check_nbr=<!--PH:LINKVALUE:POST_
CHECK:check_nbr-->&amp;t_check_date=<!--PH:LINKVALUE:POST_CHECK:check_date--
>&amp;t_check_amount=<!--PH:LINKVALUE:POST_CHECK:amount-->&amp;t_amount_appl
ied=<!--PH:LINKVALUE:POST_CHECK:amount_applied-->&amp;t_amount_open=<!--PH:L
INKVALUE:POST_CHECK:amount_open-->&amp;t_invoice_status=<!--PH:LINKVALUE:T_I
NVOICE_STATUS-->&amp;t_invoice=Y&amp;t_check_key=<!--PH:LINKVALUE:POST_CHECK
:check_key-->"><font color="#FFFF80">Select Specific Invoice</font>
</A></font>
</td>
</tr>
</table>

In screen B the logic is:

QKS
...
TEMP t_invoice CHAR*01 RESET AT STARTUP
...
FILE post_invoice IN cidb PRIMARY                &
     HTMLKEY corp_cust_id                        &
     HTMLFIELD corp_cust_id, customer_id,        &
               invoice_nbr, po_nbr,              &
               amount, date_invoice,             &
               source_system, branch_id
ACCESS VIA     corp_cust_id, invoice_nbr         &
       USING   corp_cust_id, invoice_nbr         &
       ORDERBY customer_id, branch_id            &
       REQUEST corp_cust_id, invoice_nbr, t_invoice  
...
FIELD Corp_cust_id        OF post_invoice PREDISPLAY LABEL "Corp ID  "
...
FIELD invoice_nbr         OF post_invoice PREDISPLAY LABEL "Inv Nbr  "
...

PROCEDURE INITIALIZE
BEGIN
...
  ACCEPT t_search_thread
  ACCEPT t_ph_loadid
  ACCEPT t_invoice
END

HTML 
<tr>
<td>Corp Cust Id</td>
<td><input type="text" size="11" name="POST_INVOICE:Corp_cust_id"
value="<!--PH:VALUE:POST_INVOICE:Corp_cust_id-->"></td>
</tr>
<tr>
<td>Invoice Nbr</td>
<td><input type="text" size="15" name="POST_INVOICE:invoice_nbr"
value="<!--PH:VALUE:POST_INVOICE:invoice_nbr-->"></td>
</tr>
<tr>
...
<input type="hidden" size="1"   name="T_INVOICE"
value="<!--PH:VALUE:T_INVOICE-->">

Now for the problem.

When the user enters an invoice number in the t_invoice_nbr field and clicks
on the link, the value for POST_INVOICE:invoice_nbr is not being passed.
How do I make the screen pass this value?

Here is what is being passed at run-time:

<A
HREF="/cgi-bin/phcgi.exe?PH_QKC=pc_select_invoice&amp;PH_APP=CORPCUST_APP&am
p;PH_HTML=pc_select_invoice.htm&amp;PH_ACTION=Search&amp;POST_INVOICE:corp_c
ust_id=0&amp;POST_INVOICE:invoice_nbr=&amp;t_check_nbr=98765&amp;t_check_dat
e=06/10/01&amp;t_check_amount=546.87&amp;t_amount_applied=0&amp;t_amount_ope
n=546.87&amp;t_invoice_status=&amp;t_invoice=Y&amp;t_check_key=4"><font
color="#FFFF80">Select Specific Invoice</font></A></font>

Man, I feel like I'm back in school learning PH Web; it's sooo different to
standard programming in PH4GL.

Regards,
Blue