I have a simple HTML form (FORM1) with edit boxes for "Salesperson ID" (linked to a parameter &SalespersonID) and "Customer Number" (liked to a parameter &CustNum) that I need to pass to another HTML form (FORM2) when the "Add" button is pressed.
When the "Add" button is pushed, it runs the .fex and pulls the "comm_add.html" file exactly as I want it to... but now I need to pass the parameters from the two edit boxes to the "comm_add.html" so those two columns are filled in when the "comm_add.html" HTML page loads.
Does anyone know of a way to pass the parameters from FROM1 to FORM2 using the -HTMLFORM code? Or, FOCEXEC?
I am currently using this method in a different part of my HTML page (FORM1), but this part pulls a .fex file first, then I have a link on one of the columns that passes the parameters through the -HTMLFORM .fex file (call_update_form.fex) and then on to FORM2 using a normal FOCEXEC statement:
This message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8.1.05 Windows, All Outputs
June 21, 2019, 03:40 PM
FP Mod Chuck
Deej
This is an untested answer but you should be able to reference the parameters with the !IBI.AMP.parmname; syntax where parmname is the case sensitive name of the parameter on your initial screen.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
June 21, 2019, 04:45 PM
Deej
As in changing the .fex code in my "Add" button link?
Not sure of the syntax for a -HTMLFORM statement to send the parameters... I'm assuming what I have above in the "To:" section is correct syntax-wise?This message has been edited. Last edited by: Deej,
WebFOCUS 8.1.05 Windows, All Outputs
June 26, 2019, 01:07 PM
FP Mod Chuck
DeeJ
I think the references to !IBI.AMP.SalespersonID; !IBI.AMP.CustNum; need to be inside the htm file as a hidden field.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
June 26, 2019, 02:17 PM
Deej
Thanks for the reply Chuck,
The &SalespersonID and &CustNum parameters are already in the htm file, but I'll take a look to be for sure.
WebFOCUS 8.1.05 Windows, All Outputs
June 26, 2019, 04:04 PM
John_Edwards
You need to embed your amper variables into the url you're calling in the focexec. In your focexec, make your line of code something on the lines of this --
This is your goal. That url is how you pass form variables on web-based systems. The html form specification uses a ? to start the list of variables, an ampersand between each to separate them.
But there's a little complexity here, because your focexec is going to want to resolve that ampersand before the CustNum parameter into an amper variable. You're in a focexec after all. That will hose the text of your url call.
Note the concatenation after SalespersonID. That separates the ampersand from the text that follows. FOCUS will leave it alone. Then you make your call with --
-HTMLFORM &URL_CALL
I'm just shooting from the hip so I'm sure there's a few errors hiding in what I show above, but that's the concept. You're hand-assembling a Method=Get html form call on the url line, which WebFOCUS is more than happy to take and pull amper variables out of.
I've done this about 100 times, though usually I'm doing it in javascript inside a focexec. The concept is the same though, and it works well up through 2048 characters. After that you have to create a Post form call, which is an advanced topic!This message has been edited. Last edited by: John_Edwards,
June 26, 2019, 04:25 PM
Deej
Makes PERFECT sense John, thanks!
I'll give that a shot!
WebFOCUS 8.1.05 Windows, All Outputs
June 27, 2019, 09:34 AM
Deej
John,
I gave your suggestion a shot this morning and I've tried as many variations of your &URL_CALL that I can think of... even putting the actual parameter values into the -SET line.
Everything I've tried gives me the exact same error:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <ibfsrpc _jt="IBFSResponseObject" language="EN" localizeddesc="Names cannot contain any of the following characteres: Space&*()|:;",?/" name="runAdHocFex" returncode="8017"
returndesc="Names cannot contain any of the following characteres: Space&*()|:;",?/" subreturncode="0" subsystem="" type="simple">