×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to include a field from a hold file in an embedded html in a fex?

How to include a field from a hold file in an embedded html in a fex?

How to include a field from a hold file in an embedded html in a fex?

(OP)
Here is the code of what I am trying to do.  I want to pull only the Project Number field from the hold file onto my html form.  Any help would be greatly appreciated!

SET SQLENGINE=SQLORA
SQL SET SERVER &MYSERV

SQL SELECT
    det.AGREEMENT_NUM,
    det.PROJECT_NUMBER,
    det.DURATION
FROM AGREE_DETAIL det
WHERE det.AGREEMENT_NUM = '018060621';

TABLE
ON TABLE HOLD AS INVOICE
END
-RUN

-HTMLFORM BEGIN
<HTML>
    <TITLE>ADVANCED FUNDS INVOICE REQUEST</TITLE>
<HEAD><CENTER><STRONG>ADVANCED FUNDS INVOICE REQUEST</STRONG></HEAD>
    <HR WIDTH=640>
<BODY>
    <TABLE WIDTH=85% BORDER=0>
    <tr><td>TO: </td>
        <td>Dept. 9513</td>
        <td>FROM:</td>
        <td>Dept. 9112</td></tr>
    <tr><td>NAME:</td>
        <td>Margie Shuford</td>
        <td>PROJ NUM:</td>
        <td>!IBI.FIL.INVOICE.PROJECT_NUMBER;</td></tr>
</BODY>
</HTML>

RE: How to include a field from a hold file in an embedded html in a fex?

First of all, there's nothing in your request to prevent MULTIPLE values of Project Num from being stored in the HOLD file. So, assuming the same value of PROJECT_NUM is on each record in the file, here's what I would do. Since this is an SQL SELECT, you don't know the formats of the fields beforehand (you may, but they could change). So, once you've held all the data, I'd create a second HOLD file from the first, with just one project number. To do this, issue the following:

CODE

TABLE FILE INVOICE
PRINT PROJECT_NUMBER
ON TABLE HOLD AS PROJNUM FORMAT ALPHA
WHERE RECORDLIMIT EQ 1
END
-RUN

This will write out the first instance of PROJECT_-NUMBER to a file called PROJNUM, and will save it as character format (if it was numeric, you DON'T want it in internal/binary format). The final '-RUN' executes the commands.

Then, issue the following:

CODE

-READ PROJNUM,&PROJECT_NUM

This will read the first (and only) value in that file into a Dialogue Manager variable called &PROJECT_NUM. From then on, you can use this value (as !IBI.AMP.PROJECT_NUM;) in your HTMLFORM.


RE: How to include a field from a hold file in an embedded html in a fex?

(OP)
Thank you for your help.  However, is there a way to specifically pull from the table and not have to write to a variable?  The example I provided is very streamlined.  I really need to do this on about 30 fields and was trying to avoid creating variables.

RE: How to include a field from a hold file in an embedded html in a fex?

Well, by definition, the values you want to include are variables (they may have differing values). The only other way is to have your output LOOK like an HTML form, and then -INCLUDE that. It's more complex, and using a variable is much easier to create, and modify. Is there any reason NOT to use variables? My example was for a single variable; it could just as well read all 30 variables. You either extract them in a FIXED format, and read them in with a length specification for each field:

CODE

-READ extractfile &VAR1.A10. &VAR2.A5. &VAR3.A1.

or write them out comma delimited, and read them in free-format:

CODE

-READ extractfile, &VAR1 &VAR2 &VAR3

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close