As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Hi, Is there a function to call a javascript program from Maintain. For example, to call Maintain from javascript use IWCTrigger. I need to go in the opposite direction. Thank you, NickThis message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Here is an interesting way to make a piece of dynamic javascript in Maintain.
Step 1: Create an empty javascript file. Step 2: Add the javascript file to the form, not as a link. Step 3: scriptfilename.lines(scriptfilename.lines.FocCount + 1) = 'javascript line;' ;
In you maintain code add step 3 before showing the form, then the scrip line will be executed when the HTML form in loaded.This message has been edited. Last edited by: Waz,
Hi Waz, Thanks for the quick response. I want to send emails to selected reciepients with a custom user entered message for each receipient. I have a routine, provided by Mark, that sends emails launched via the onclick event.
I would like to use this javascript code to send emails to selected receipients. Since each receipient will have a customized message, I have to send multiple emails. The process that evaluates if an email will be sent is in Maintain.
High level logic is: IF EMAILIND EQ 'Y' THEN "CALL EMAIL Javascript";
Hope this helps.
Thank you, Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Calling the javascript function from a button is functioning properly but I need to call the javascript function from the Maintain procedure. For example,
jscall.mnt
MAINTAIN $$Declarations Case Top Winform Show Form1; EndCase Case email compute to/a100='nick@njginc.com'; compute from/a100='nick@njginc.com'; compute subject/a100='hello'; compute body/a100='this is a test'; call jscall endcase END
Currently, the form has a button where the js code is as follows:
If the only function of the maintain is to call a js functions, then you might be better off writing a html solution for your problem. Calling js from maintain can't be done as is. You'll have to do this through some action within maintain that is linked to a javascript function. It can be a js linked to a button, which gets executed upon clicking the button, or linked to the form, which gets executed when the form gets loaded. If you don't have forms, then sorry, no javascript functionality. In your case it seems you have a form. Then I'd try to put all the data you need to send out on the form (hidden or not) and have a javascript program read all this data and process it. Link the javascript to the form in such a way that it gets executed when the form loads.
Hope this helps...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Hi GamP and Waz, Thanks for your help. So far, with assistance from you and my friends at IBI, I've been able get it to work by using an HTML object as follows: 1. Populate a stack with the javascript statements. 2. Use the stack as the data source for the HTML object. 3. Trigger execution of the HTML object by a form refresh.
This solution assumes that the form will remain open and the HTML object will be triggered by a form refresh. Since the objective is to send emails to selected individuals each with a customized message, this works but the user will have to click a second button to exit this form. This is no biggie, I think.
Thank you, Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.
Nick, what I gave you does call a js function from maintain. the example has the button to call a maintain case. This case then populates the js code embedded in the winform with the js call.
If I understand you correctly this will work for you.
The original concept was a user would set the email indicator for that person to 'Yes', state a customized message in a comments field and the email would be sent upon leaving that person's record. Since there are a number of ways to leave the person's record and the approver may exit after entering a person's record, I choose to trigger the email creation and distribution process from a button. So, Waz your technique will work and I will compare solutions later today. GamP, I will integrate your suggestions to close the page and post a message.
Thank you both for assisting me as I am a seasoned FOCUS programmer but relatively new to WebFOCUS and javascript.
Nick
WebFOCUS 7.7.03 & 8.0.7 Windows HTML, Excel, PDF, etc. Also, using Maintain, etc.