Focal Point
Launch screen for MODIFY to update a file

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

July 16, 2007, 04:18 PM
<Jax>
Launch screen for MODIFY to update a file
We're creating a hold file for sports and funding and want to give users the option to add sports codes and/or and fund code.

The original hold file is created with a focexec, including a join between the activity tables (for sports codes) and funding tables. We want the users to update the table by adding either the activity code or sports code, as well as descriptions.

The sticking point is how to put the entries in an HTML launch page in order to update the file.
Thanks in advance!
July 17, 2007, 07:49 AM
Maintain Wizard
Have you thought about using Maintain? Maintain allows you to access more than 15 tables per application. It also helps you build Winforms to display the data and allow the user to update and include.

You need to be licensed to build Maintain applications, but if you are, an application to update two tables is very easy to build.

Mark
July 17, 2007, 08:40 AM
Tony A
Jax,

Mark is right, Maintain would probably be the best route, however it does use CGI so you might have issues running through MRE? I'm sure Mark will correct me if I'm wrong here.

However, saying that, I use an HTML screen to execute an update via MODIFY, so it can easily be achieved, you just have to think about what you need to do.

Think of a URL or command line to run a fex -
http://[webserver id]/ibi_apps/WFServlet?IBIAPP_app=[app name]&IBIF_ex=[fex name]&Parm1=[value] etc. .........

All you need to do is ensure that your FORM has the INPUT controls named IBIAPP_app, IBIF_ex and any variables you want to pass to the fex.

Whilst you are on the Forum, please visit your profile and add the release, platform and usage to your signature please Smiler That way we know how to target any advice according to your set-up etc.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
July 17, 2007, 09:38 AM
<Jax>
The client does not have a MAINTAIN license, though it's a valid discussion point.

I think we found a fix for the MODIFY prompts and we're moving forward.

Note to Tony - working at a few sites so things change. These folks are on 7.6.1 production and 7.1.4 test, on Unix servers.
July 17, 2007, 09:56 AM
Maintain Wizard
One note, ever since 7.13, Maintain has fully supported Servlet, so it can integrate with the rest of the WebFOCUS suite.

Mark
July 17, 2007, 09:59 AM
TexasStingray
PS I believe to use modify on a table that stays around after the focus/webfocus session has ended requires a MAINTAIN license. Check with your local branch office.




Scott

quote:
Originally posted by Maintain Wizard:
One note, ever since 7.13, Maintain has fully supported Servlet, so it can integrate with the rest of the WebFOCUS suite.


Thanks Mark, that's good to know Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
We opened a case with Technical Support to confirm that MAINTAIN is required for MODIFY. Details to follow.
Question for Maintain Wizard

Can you run a maintain procedure from mre now it uses the servlet?

Regards

John



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Jax, MODIFY can be used without MAINTAIN, oh very definitely. I run MODIFY 24/7.
Your Modify task, outlined above, can be done, if its not too big, with a form launched from a fex, and that form gathering a few bits of data from the user and running a fex that performs the MODIFY.
This, too, i do. I allow my users to click on a STOCKNUMBER and create a STOCKCLASS code for it, either assign to one existing or create a new one.
EG:
1)fex1 lists some products with a drilldown on the stocknumber to fex2.
2)fex2 creates an input form to gather the user input... fex2 is mostly html code
-HTMLFORM BEGIN
<HTML>... 
 just code your FORM right in here.
selects with dropdown lists for users to chose from..whatever you need.
the 'action' of this form runs fex3, the modify fex

</html>
-HTMLFORM END

3) fex3 takes as parameters the input from the form in fex2, does the modfiy, and reruns fex1 with the list of products now showing the user's new classification code.
Any help?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
That is the normal method Susannah, but the method that I use does not require the FEX to be rerun - which I think that yours does?

OK, a bit of a porkie, but the end user does not realise that a fex has been executed.

What I do is to acquire the input from the user of the HTML form and then run an adhoc fex from JavaScript. It makes use of the IB supplied JavaScript functions (why reinvent the wheel?) which makes my life easier Smiler

Basically, the JavaScript is something like this, where "keyfield" and "upd_value" are passed as parms to the JS function -
  // The XML for this only contains headers and no data so nothing really happens on the client
  // as the adhoc request is a MODIFY process to update a file
  // Note: that the carriage return and line feed chars are pre-escaped.
  var request = '/ibi_apps/WFServlet?IBIC_server=EDASERVE&|IBIAPP_app=reports&|IBIF_adhocfex=
     MODIFY FILE SOMEFILE%0D%0AFREEFORM KEYFIELD UPD_VALUE%0D%0AMATCH KEYFIELD%0D%0AON MATCH UPDATE
     UPD_VALUE%0D%0ADATA%0D%0A'+keyfield+','+upd_value+',$%0D%0AEND&|Rand='+Math.random();
  if(request) {
    var xmlDoc = getXml(request);
  } else {
    alert("Error with Modify process");
  }

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
i'm just rerunning the original report to give the user confidence that the codeelement was changed, and the opp to proceed to the next one.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
susannah

Sorry, I did not realize you work for IBI. If you don't I would suggest that Jax still get the official word from IBI. I know that they allow you to use modify to create temporary files (files that are deleted when the job completes), but I believe that if the file is not deleted when the job completes you are required to get a license for MAINTAIN.




Scott

i don't. MODIFY in all its glory works in the regular product.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Susannah,
I am looking to develop something similiar where the user needs to manage a table via fex/html/javascript. Please share an example if you have it handy. I have created one fex to display all data and have drilldowns to add/edit/delete on certain columns. I would like to display a launch form for the selected field and have a save/edit/delete buttons to call a sql pass thru fex.

Please advise

Thanks!


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
an example of what?




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Trying to figure how to display fex as html form with field(s). That would be fex2 in your scenario.

Hope I'm making sense.please let me know
Thanks!


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
nope, you're not making sense. don't know why what you want to do is difficult. seems so basic.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
If you only want to insert or update a record at a time you can do this using SQL Passthough. Variable from your HTML launch page can be fed to the DB as shown below.

 
ENGINE SQLORA SET DEFAULT_CONNECTION [adapter name]
SQL SQLORA SET ERRORTYPE DBMS
SQL SQLORA [or SQLMSS, SQLDB, etc.]
INSERT INTO [your tablename]
         (COUNTRY, CAR, MODEL)
  VALUES ('&COUNTRY', '&CAR', '&MODEL');
END



WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
I realized that its quite simple to present a fex in the form of "HTML Form" with just inputs and "INSERT","UPDATE", "DELETE". I have the buttons calling the necessary procedures and executing sql pass thrus. I need to give a message that the row has been inserted/updated/deleted. Any ideas?
I Can see this
(FOC1364) ROWS AFFECTED BY PASSTHRU COMMAND : 1/INSERT but i'd like to make it more presentable and as a Javascript Alert.

Please share any ideas.

Thanks again in advance.
You can make it as complicated as you wish. Personally I prefer to keep this simple and as easy as possible to maintain after I leave. In situations like this I added a fex with the code below and added a -INCLUDE to run it at the end of my SQL Passthrough.
  
-HTMLFORM BEGIN
</br>
<b>SQL Maintenance Action Completed  </br>
</b>
-HTMLFORM END



WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF
Alex,
How to customize sql return message so we know the action is completed or failed?

Like I said I see this msg but I'd like to make it more meaningful to the user (FOC1364) ROWS AFFECTED BY PASSTHRU COMMAND : 1/INSERT like
"1 new row has been inserted to the table" etc., its always either insert, update or delete but, i'd like to be able to display a decent msg. via html.

Thoughts?
There are lots of threads on the FORUM on SQL Passthrough. Also check out this link: http://documentation.informati...7/source/topic54.htm


WF 7.7.04, WF 8.0.7, Win7, Win8, Linux, UNIX, Excel, PDF