How to close a form within script

Hello,
I'm using Adobe LiveCycle Designer v 8.2 to develop an Order form. I'm fairly new to developing in LiveCycle, and would like to ask the following question that I couldn't find an answer to elsewhere.
I'd like to know if it is possible to close a form down within a script, if certain conditions are met/not met. Specifically, when my form loads I am testing the user's version of Acrobate Reader. If it is not above the stated version, I would like the form to close down. At the moment, it displays the warning message correctly but then continues to try and load the form.
I guess the JavaScript equivalent of Me.Close() is what I am after
if 
(xfa.host.version < 8.101){
xfa.host.messageBox("Your version of Adobe Acrobat Reader is not recent enough to use this form.",
"Wrong version of Adobe Acrobat", 1);//Code to close form to go here
Can anyone help?
Thanks
Matt

You will be able to close the form but you will not be able to close the Reader application. The command you want is event.target.closeDoc(). This will close the currently active Document. Note that if you are diosplaying in a browser then it will not close the doc ....it will only work form the Reader/Acrobat applications.
Paul

Similar Messages

  • How to assign modified forms (SAP scripts etc.,) to Dunning texts

    Hello, how do I assign forms (SAP scripts etc.,) to dunning texts according to no 5 above?
    I've copied the form f150_dunn_01 and modified it. Now I want to assign my modified form to dunning text. In txn fbmp I have created new procedure and when I clicked on Dunning texts it takes me to dunning text screen where I should be able to assign my modified form. But the screen is greyed out and not editable. Is there anything I'm missing or I've permission issue?
    Please help
    Regards
    Naz
    Most of the config for Dunning is done with TCode FBMP.
    Key Steps are :-
    1.     Define the dunning procedure or use the standard
    2.     Define the dunning levels (desired stages of reminder)
    3.     Define the dunning interval (frequency of reminder)
    4.     Line item grace periods & Min.days in arrears (acct) govern the criteria for picking items to be dunned along with Minimum amounts
    5.     Assign forms (SAP scritps etc.,) to dunning texts. Forms contain the contents of the reminder notice and the format of notice.
    6.     You can include the Sp GL Transactions as well.
    7.     Customer/Vendor Master Records needs to be updated with the Dunning
    8.     Procedure etc, Dunning tab in the master data
    9.     Use F150 to run.

    Hi Praveen,
    Ok let me go through the steps that I have done so for.
    1. New dunning procedure 004 been created in Txn FBMP
    2. Then by choosing the assigned dunning procedure 004, trying to update the form by selecting the company code and then Dunning text. But the screen is grayed out.
    Please pass me your email address then I will send you the screen shoots.
    Thanks
    Naz

  • How to close infopath form through code?

    Hi All,
    How to close infopath form through code, thanks in advance!

    Hi Sam,
    Please check if the articles below can be help:
    http://www.bizsupportonline.net/browserforms/programmatically-submit-infopath-form-sharepoint-send-email-close-form.htm
    http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • How to close NetStream in class script

    How to close NetStream in class script
    I use NetStream action to play the video. It’s working perfectly. Want to know how I can close my NetStream video to clicking on the button as in class scrip. I tray this
    ns.close();
    but got error
    NetStream class action
    package {
        import flash.display.SimpleButton;
        import flash.events.MouseEvent;
        import flash.media.Video;
        import flash.net.NetConnection;
        import flash.net.NetStream;
        import flash.media.SoundTransform;
        import flash.display.MovieClip;
        public class clickbutton extends SimpleButton {
              var ns:NetStream;
              var previousVolume:Number = 1;
              public function clickbutton() {
                    this.addEventListener(MouseEvent.CLICK, clickF);
              private function clickF(e:MouseEvent):void{
                   MovieClip(this.root).gotoAndStop(2, "Scene 1");
                   var nc:NetConnection=new NetConnection();
                   nc.connect(null);
                   ns=new NetStream(nc);
                   var video:Video=new Video(320, 200);
                   video.x=(stage.stageWidth-320)/2;
                   video.y=(stage.stageHeight-200)/2;
                   ns.client=this;
                   this.parent.addChild(video);
                   video.attachNetStream(ns);
                   ns.play("video_test.flv");
                   controlsF();
                   this.removeEventListener(MouseEvent.CLICK, clickF);
                   this.parent.removeChild(this);
          private function controlsF():void{
              MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);
              MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);
              MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);
              // add volume listener here.  you'll need to decide how you want to control volume.
                                                    function playF(e:MouseEvent):void{
                                                                    ns.resume();
                                                    function pauseF(e:MouseEvent):void{
                                                                    ns.pause();
                                                    function muteF(e:MouseEvent):void{
                                                                    if(ns.soundTransform.volume>0){
                                                                    var st:SoundTransform=ns.soundTransform;
                                                                    previousVolume=st.volume;
                                                                    st.volume=0;
                                                                    ns.soundTransform=st;
                                                    } else {
                                                                    st=ns.soundTransform;
                                                                    st.volume=previousVolume;
                                                                    ns.soundTransform=st;
                                    public function onMetaData(eobj:Object): void {
                                                    // this needs to be in the scope of your loader
                                    public function onPlayStatus(eObj: Object): void {
                                    public function onXMPData(eobj:Object):void{

    I make to keyfram in my time line.
    In 1st keyfram on the video button I use this code
    package {
         import flash.display.SimpleButton;
         import flash.events.MouseEvent;
         import flash.media.Video;
         import flash.net.NetConnection;
         import flash.net.NetStream;
         import flash.media.SoundTransform;
         import flash.display.MovieClip;
              public class palyvideo extends SimpleButton {
                   var ns:NetStream;
                   var previousVolume:Number = 1;
                        public function palyvideo() {
                             this.addEventListener(MouseEvent.CLICK, clickF);
                        private function clickF(e:MouseEvent):void{
                             MovieClip(this.root).gotoAndStop(2, "Scene 1");
                             var nc:NetConnection=new NetConnection();
                             nc.connect(null);
                             ns=new NetStream(nc);
                             var video:Video=new Video(320, 200);
                             video.x=(stage.stageWidth-320)/2;
                             video.y=(stage.stageHeight-200)/2;
                             ns.client=this;
                             this.parent.addChild(video);
                             video.attachNetStream(ns);
                             ns.play("video_test.flv");
                             controlsF();
                             this.removeEventListener(MouseEvent.CLICK, clickF);
                             this.parent.removeChild(this);
                   private function controlsF():void{
                        MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);
                        MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);
                        MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);
                        // add volume listener here.  you'll need to decide how you want to control volume.
                   function playF(e:MouseEvent):void{
                        ns.resume();
                   function pauseF(e:MouseEvent):void{
                        ns.pause();
                   function muteF(e:MouseEvent):void{
                        if(ns.soundTransform.volume>0){
                        var st:SoundTransform=ns.soundTransform;
                        previousVolume=st.volume;
                        st.volume=0;
                        ns.soundTransform=st;
                   } else {
                        st=ns.soundTransform;
                        st.volume=previousVolume;
                        ns.soundTransform=st;
              public function onMetaData(eobj:Object): void {
                   // this needs to be in the scope of your loader
              public function onPlayStatus(eObj: Object): void {
              public function onXMPData(eobj:Object):void{
    In 2nd keyfram I use this code on reply button
    package  {
         import flash.display.SimpleButton;
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.media.SoundMixer;
         import flash.media.Video;
         import flash.net.NetConnection;
         import flash.net.NetStream;
              public class reply extends SimpleButton {
                                  public function reply() {
                                            this.addEventListener(MouseEvent.CLICK,clickFF);
                                  private function clickFF(e:MouseEvent):void{
                                            SoundMixer.stopAll();
                                            MovieClip(this.root).gotoAndStop(1, "Scene 1");
                                            ns.close();
                                            //video.attachNetStream(null);
    But when I click on reply button I got this compiler error

  • How to close a Form in LWUIT

    Hi,
    How do I close a form in LWUIT and go back to the form that opened it? There is no close or dispose command. There is a setVisible command
    but I don't seem to know how to use it. It doesn't seem to have any effect when used on a form. I have even tried to call show() on the form that
    opened the form I am trying to close. That doesn't work either.

    altayli wrote:
    I fixed it by converting Vector to Array..Thank you all
    Array -- do you mean java.util.ArrayList object from Java SE? are you going to use it in j2me MIDP application?

  • How to close PDF form in Browser

    Hi,
    Does anyone knows if there are any way to close a PDF form that is opened in a browser (Internet Explorer 6)?
    In my form, there is a button that is supposed to close the form when clicked, it is working if I launched the form in Reader but does not work in a browser.
    The script that I used in the click event of the button is:
    event.target.closeDoc();
    Thank you.

    Hi,
    heres the code
    1. Go to <Your Webdynpro project> - WebDynpro - Web Dynpro Components - <your component> - Windows right click and create a window (PdfWindow).
    2. Place the view that contains pdfForm in the window PdfWindow.Create a button in the view say ClosePdf .
    3. Create a context attribute say WindowInstance of type com.sap.tc.webdynpro.clientserver.window.Window (java native type) in the component controller.Map this attribute to the context of both views (view with button and Pdfview)
    3. In the onAction of button
    IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("PdfWindow");
    IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
    window.setWindowPosition(500, 500);
    window.show();
    wdContext.currentContextElement.setWindowInstance(window); // this iwll bw used to destroy the pop up
    4. In Pdfview create a action closepopup and associate with button ClosePdf. In the action write
    IWDWindow window = wdContext.currentContextElement.getWindowInstance();
    window.destroy(); // this will close the popup.
    Note:
    you dont need wdContext.currentContextElement().setPdfVisible(WDVisibility.VISIBLE); as your pdfform is in different view.
    Message was edited by:
            Shriram Kabra

  • How to close various forms

    Hi,
    In my menus , i have 3 submenu items,
    if i click 1st item , call_form('formname'); 1st one will appear,
    if i click 2nd menu item , call_form('2ndformname');2nd one will appear,
    samething for 3rd item,
    finally if i click close int the top of the window, i have to close each form,
    My problem is if i click anyone menu item, it should replace or hide the previous window.
    I know call_form (hide and replace option was there,but i dnt know how to use ) was there , any other method is there,

    If you want to close all the three forms. Use one global variable and set it to TRUE in that close button.
    In the WHEN-WINDOW-ACTIVATED of each form
    write:
    IF :GLOBAL.CLOSEAPP = 'TRUE'
    THEN
    EXIT_FORM(NO_VALIDATE);
    END IF;

  • How to Close InfoPath Form After Submission When Two Buttons Exist?

    I have an browser-enabled InfoPath 2010 form that has two views and a submit button on each view. The form would correctly submit and close the form using one button on the form until the second button was added. After adding the submit button on a second
    view, the second button submitted/closed but the behavior on the first view changed so that the form no longer closes after submission. I’ve researched this and have not yet found a solution to allow closing the form after submission for one of the buttons.
    Things I’ve tried:
     - I’ve attempted creating multiple submit data connections for the different buttons
     - Specifying different Submit Options
     - Try closing the form with the code
     - Add another button to the non-closing view
     - Add duplicate Rule actions to "Close this form: No Prompt"
    Settings:
    Button rules:
     - Submit using data connection: SharePoint Library Submit
     - Close this form: No Prompt
    Button Properties:
     - Action > Rules and Custom Code
    The form Submit Options:
     - Send form to a single destination (a form library)
     - Choose a data connection for submit (SharePoint library submit)
     - Advanced > After Submit: Close the form
    Advanced form options:
     - Filler Features: all items unchecked (not allowing Save, etc.)
     - E-Mail Attachments: uncheck Enable InfoPath e-mail form functionality for this form template
    Resources:
    When considering programmatically submitting and closing the form, I understand from this article that the Rules run before code and I can’t close the InfoPath form programmatically by writing code behind a button that has a rule set on it:
    http://www.bizsupportonline.net/blog/2009/01/how-to-programmatically-run-code-close-infopath-web-form/
    Discussion of creating a custom Save and Submit buttons for InfoPath browser forms:
    http://markhaverty.com/sharepoint/custom-save-and-submit-buttons-for-infopath-browser-forms/

    what if you need to switch views? 
    I have the same problem in a similar situation.  I created a test button to narrow down the cause.  the button submits data & closes the form fine.  however when I add a rule to switch views before the submit & close rule, it
    breaks.  Submit still works but it no longer closes the form.  If I disable the switch-view rule, then it closes fine. 
    I tried added another rule to switch back to the main view but that didn't help. 
    switching views is an integral part of the workflow b/c I want to email the alternate view upon approval & then close the form.  So removing that rule is not a good answer unfortunately. 

  • How to close the Form

    Dear Experts,
    i have witten the following lines
    oForm = SBO_Application.Forms.Item("Modal")
    oEdit = oForm.Items.Item("no").Specific
    oEdit1 = oForm.Items.Item("name").Specific
    userTable = oCompany.UserTables.Item("TESPA_LOGIN")
         userTable.GetByKey(no)
         userTable.UserFields.Fields.Item("U_status").Value = "1"
         userTable.UserFields.Fields.Item("U_remarks").Value = curUser
         userTable.Update()
    '// Updated succesfully
    '// here i want to close the form
    oForm.close()
    the B1 is closed, when i search the error it saying the form has no value
    how to solve this
    Regards
    Mathi
    Edited by: Mathi Arasu on May 24, 2008 2:38 PM

    hi expert,
    when i use the line
         SBO_Application.SendKeys("{^}")
    symbol ( ^ ) displaying in one EditText box, the form is not closed.
    when i use the line
         SBO_Application.SendKeys("")
    the form is closed, but one message (Invalid form) is coming
    Regards
    Mathi

  • How to autosubmit a form within Taglibs

    Hello,
    i have some choicelist which i want to autosubmit onchange.
    For example, list of carTypes, should be reloaded after changing the type of car.
    I know to handle this with JS; document.form.submit() , but this isn�t really working, struts always wants to execute a forward ...
    isn�t there some standard implementation for this? thnx ren�

    You will be able to close the form but you will not be able to close the Reader application. The command you want is event.target.closeDoc(). This will close the currently active Document. Note that if you are diosplaying in a browser then it will not close the doc ....it will only work form the Reader/Acrobat applications.
    Paul

  • How to call Interactive form within Workflow ?

    Hi,
    I have created a interactive form within WebDynpro for ABAP which triggers a workflow for approval. Now I would like to open the same interactive form by the approver and approve the request.
    Any input for calling interactive form from Workflow would be helpful.
    Regards
    Ravikumar

    u need to create the events step by step in the workflow.
    first event would be the condition which should be checked so that it gets triggered when the condition is satisfied.
    second would be the the triggering in which u will get this triggered. u need to create a class in which the adobe form's code will be present like the FM it generates etc.in this class u will to write some methods for eg: if u create method say send_mail in this class u will code all the logic for sending the adobe form as a mail and u assign this in the workflow. So now, in the workflow all the methods that u assign will get triggered.

  • How to close custom form from standard form.

    Hi,
    I have the following requirement which I can not handle.
    I open custom form from menu special position which is available in standard form on particular window and block only. So custom form may be open only when the window of standard from is open.
    My requirement is to close custom form when the window of standard form is closing or when standard form is closing. I can not modifiy stanard form so I need to use forms personalization. I have problem in form personalization:
    1) to handle "when-form-exit" event / trigger (when window closing I can handle by when "new item instance" where cursor goes and appropriate conditions).
    2) to navigate to my custom form to close it, like "go_form" in Forms Builder.
    Is it possible do achieve with forms personalization or maybe in some other way?
    Kind regards,
    Marcin

    Hi,
    The standard program is list of vendors address(AQZZ/SAPQUERY/FKF1============)or we can also access through the :sapmenu->accounting->financial accounting->accounts payable->information system->reports for accounts payable accounting->master data->S_ALR_87012087-Addresslist.
    Regards,
    naresh

  • How to close current form but leave calling form open

    My case is like this, I am working on one form. It have 2 functions. One is serach function, let us call it A, the other is display/entry function, let us call it B. I first start window A to search record. From that record I open window B, when I close window B, I want to leave window A open so I can start a new search.
    Right now, when I close widows B, window A closed too. How can I close only window B. I tried both APP_NAVIGATE.EXECUTE and FND_FUNCTION.EXECUTE but did not work out.

    Thank you very much.
    The problem is how can I find out what is the module name or window name. This is a heavily custom Oracle Apps form CSXSRISR. It is quite big and I just got lost into those data block/trigger stuff.
    Is there a easy way to find out the module for each window?
    Thanks

  • How to call fn form within a procedure? - pl help

    Hello
    I have a procedure which has a set of statements that is called repeatedly.i would like to put them inside a function, passing an IN parameter as well. How to do that? and how do u call the fn from within the procedure?
    Pl help.
    rgds

    SQL> create or replace package calls is
      2      procedure proc ;
      3  end ;
      4  /
    Package created.
    SQL> create or replace package body calls is
      2      function func(p_param in number) return number is
      3      begin
      4          dbms_output.put_line('param is:'||p_param) ;
      5          return(p_param * 2) ;
      6      end ;
      7      procedure proc is
      8          ret_val number ;
      9      begin
    10          ret_val := func(100) ;
    11          dbms_output.put_line('ret_val='||ret_val) ;
    12      end ;
    13  end ;
    14  /
    Package body created.
    SQL> exec calls.proc ;
    param is:100
    ret_val=200
    PL/SQL procedure successfully completed.
    SQL>Message was edited by:
    Kamal Kishore

  • How to close a former Apple ID

    My Apple ID is my current email. I stopped using another email service a year ago.  How do I get Apple to stop referring that old email address?

    Apple ID: Contacting Apple for help with Apple ID account security - Apple Support
    Pete

Maybe you are looking for