Focal Point
[CASE OPENED]WF Maintain application linked to Webfocus procedure

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5587022686

April 24, 2017, 04:31 PM
Nova27
[CASE OPENED]WF Maintain application linked to Webfocus procedure
Hello,

I am working on creating a Webfocus Maintain application to add/update/delete records from a particular database - this application will be available to end-users to query the database for a certain Customer and then update/delete the record as well as Add a new customer/record to the database.

I have created a WF report (procedure) and a Maintain procedure to do this - also have all the forms in place for adding/updating/deleting records... Application works fine when I run the application...

Currently I have limited my master file to spit out only 100 records for testing so that I can see how Maintain works as well as to check if I can add/update/delete records..

My real test is to have the user input the customer number and based on that my webfocus procedure will spit out only those records into my Maintain HTML table where I can then select the record to update/delete... I can't get the report to prompt for the input-parameter... If I introduce the WHERE customer EQ &Cust_no then it just doesn't prompt ... Also, I have the ON TABLE PCHOLD line in my report so that Maintain reads my report output into it's HTML table.. I think that this line is maybe preventing the user-prompt, but if so then how would I do it?

Has anyone tried this before? If so, can you please help me out here?

Thanks in advance!

This message has been edited. Last edited by: Nova27,


WF 7.7.03, Win 7
April 25, 2017, 01:07 PM
Maintain Wizard
Nova
Do you need to have the user select the record from a report? We could easily create a form where the user enters the record value. We can then either pass that variable to the Table (received as &1) or just use Maintain Next with Where to retrieve the desired record.

Mark
April 25, 2017, 01:12 PM
Deana
Good morning,

Are you executing the procedure from your maintain code? Or are you executing the maintain code from a procedure? Is your procedure a straight TABLE FILE or does it execute sql?

If you open your maintain code and the execute the procedure, here is an example of something similar I currently use.

Maintain Code
MAINTAIN FILE COURSEBYLOCATION

$$Declarations

Case Top
INFER coursebylocation. COURSEBYLOCATION. FacilityCode INTO StkCourse;

COMPUTE
FacilityCode/A4 = '';
CourseCode/A4 = '';

Winform Show Form1;

EndCase

CASE selectRecords
STACK CLEAR StkCourse

-*OPTION 1 –external procedure not needed to retrieve data
REPOSITION coursebylocation. COURSEBYLOCATION. FacilityCode
FOR ALL NEXT coursebylocation. COURSEBYLOCATION. FacilityCode INTO StkCourse
WHERE coursebylocation. COURSEBYLOCATION. FacilityCode = FacilityCode
AND coursebylocation. COURSEBYLOCATION. CourseCode = CourseCode

-*OPTION 2 – execute external procedure
EXEC GetCourseByLocation
FROM FacilityCode CourseCode
INTO StkSelectAttendance;
EndCase

END

The form has 2 input fields bound to FacilityCode and CourseCode and one button. The customer enters the correct codes and then clicks the button. The onClick event code is PERFORM selectRecords.

Focexec code – (my example executes a stored procedure)
-SET &FacilityCode = &1; (parameters passed to focexec are named &1, &2, etc. I set to a logical name for simplicity)
-SET &CourseCode = &2;

ENGINE SQLMSS END SESSION
-RUN
-* CREATE SQL SESSION
SET SQLENGINE = SQLMSS
ENGINE SQLMSS SET DEFAULT_CONNECTION ConnName;
ENGINE SQLMSS SET CONVERSION LONGCHAR ALPHA
END
-RUN
SQL SQLMSS
EX dbo.storedProcName '&FacilityCode', '&CourseCode’;
TABLE FILE SQLOUT
PRINT FacilityCode, FacilityName, EffectiveDate, ExpirationDate
ON TABLE HOLD AS HOLDRSLT
END
TABLE FILE HOLDRSLT
PRINT FacilityCode, FacilityName, EffectiveDate, ExpirationDate
ON TABLE PCHOLD
END


Deana


WebFOCUS 7.6.8 and 7.7.03; Windows Server 2003 R2 and Windows Server 2008 R2, respectively; Development environments - Windows Server 2003 R2 and Windows 7 Professional, respectively;
excel, html, pdf
April 25, 2017, 03:15 PM
Nova27
quote:
Originally posted by Maintain Wizard:
Nova
Do you need to have the user select the record from a report? We could easily create a form where the user enters the record value. We can then either pass that variable to the Table (received as &1) or just use Maintain Next with Where to retrieve the desired record.

Mark


Hi Mark,

No I don't have to have a report as such, I just to create a user-input variable where the user inputs a customer or searches for a customer and then the result-set shows up in a tabular format, where they can then edit/delete the record.

I am not aware of Maintain Next with WHERE clause.. can you please post an example or sample code? or if it is mentioned in some manual, I can gladly go look for that.

Thanks!


WF 7.7.03, Win 7
April 26, 2017, 11:37 AM
Maintain Wizard
Hi Nova
Send me a PM at Mark_Derwin@ibi.com and I will send you a simple search test.

Mark