Another delete sub form question.

I can delete a specific sub form as long as the button that is used to delete the sub form resides in the the sub form using,
_Subform1.removeInstance(this.parent.index);
So how do delete a specific sub form using a script in a button that is in another sub form? If I use the same line of code the first occurance of a sub form is removed in every case and not the one I want to get rid of.

You have to pass in the index of the specific subform in Subform1 that you want to remove. It works when the button is in the subform because this.parent.index is the index of the subform containing the button. If you move the button out of the subform you are passing in the index of the new parent to the button which is not the correct index that you want to remove.
Chris
Adobe Enterprise Developer Support

Similar Messages

  • Question about scripts in repeatbel sub-form objects

    Hi,
      I am working on creating a form which has a sub-form that can be repeated as many times as the user wants to. There is an ‘Add’ button which creates an instance of the sub-form on the form, when clicked.
    On the sub-form I have 5 numeric fields say a1-a5 and 1 field say b1 which is the sum of all these 5 fields.
    On the Main form I have a 2 fields - say t1 and f1.
    The requirement is t1=f1+b1+(sub-form instance 2’s b1)+(sub-form instance 3’s b1)+ and so on …depending on as many sub-form instances there are that the user adds.
    I have created Actions using the Action Builder such that when any of a1 to a5 fields are exited, b1 will be updated with the sum of a1-a5. At the same time t1 will be updated with sum of f1 and b1.
    This works great for 1 instance of the sub-form. But when ‘Add’ is clicked and a second instance of the sub-form is added, then the script does not work as it did for the first instance of the sub-form. So for any instances of the sub-form added, when values are added to a1-a5 and the fields are existed, b1 does not get updated.
    How can I fix this?
    See attached form that I am creating for clarity.
    ‘Total Hours worked this week’ is the t1 I was talking about. See how it gets updated when values are entered in any of the hour fields. It works fine with the default instance of the T100/Strategic/Advantage Customer Information sub-form as well. But when I click on ‘Add Customer’ button to add another instance of the sub-form, it does not work as expected.
    Please let me know if it is still not clear and I can explain the issue.

    Vjay's solution works great! Essentially, take out all of your other programming on the individual fields, and hard script the field you want the sum to show on. By directly referencing the fields, Adobe is able to tell the difference between one instance and another and doesn't get them mixed up. (I have found for some of these dynamic functions, the Action Builder doesn't really work, so you need to code by hand)
    My only suggestion, would be to perhaps modify Vjay's code a little, and use Javascript instead of Formcalc. We have run into the problem where if a user is using the form from a webserver or something and hasn't actually been saved to the user PC, the Formcalc scripts won't run, only Javascript. But it all depends on how you are using your forms.
    Here is your line of code changed to Javascript, in case you want to make that change. (there's really not much difference at all)
    this.rawValue = sum(CustomerTimeBD.Row1.Cell1.rawValue + CustomerTimeBD.Row1.Cell2.rawValue + CustomerTimeBD.Row2.Cell1.rawValue + CustomerTimeBD.Row2.Cell2.rawValue + CustomerTimeBD.Row3.Cell1.rawValue + CustomerTimeBD.Row3.Cell2.rawValue + CustomerTimeBD.Row4.Cell1.rawValue + CustomerTimeBD.Row4.Cell2.rawValue + CustomerTimeBD.Row5.Cell1.rawValue);

  • Imported Form and sub-form from another database. Sub-form not creating new records tied to parent form's data.

    I have imported all objects from an old access db (.adp file) into a new db (.accdb).  All of my data lives in sql server so I have added all the tables and views to the .accdb as linked tables.  My forms all connect to data, but I am having issues
    with a sub form.  The sub form does not allow for creation of children records tied to the parent record the way the old db did/does.
    Correct - old format .adp file (notice the empty second record in sub-form with the defaulted date of today's date):
    Incorrect - new .accdb file (notice the lack of empty second record in sub-form like above):
    If I click the create new record icon in the bottom of the subform, it creates a completely blank record not tied to the parent record (fields blacked out in screen shots above).  When using this button all parent record fields are blank.  
    I have also verified the child table used in the sub-form has a valid Fky relationship to parent table used in the parent form.
     

    Have you checked each forms 'Filter' property (in Design view) to make sure they are blank and that each forms 'Filter On Load' property to make sure it is set to 'No'? Also, you might try inserting the following commands in each forms On
    Open event:
    DoCmd.RunCommand acCmdRemoveAllFilters
    DoCmd.ShowAllRecords
    If you can open each forms Record Source and they are showing that new records are able to be entered (the new record * is showing at the bottom of the recordset), then check each forms On Load and On Open events to make sure there is no filtering.
    In addition, check any macro or VBA commands behind the button that opens the main form to make sure there is no SQL filtering in the DoCmd.OpenForm command.
    If one of the forms Record Source does NOT allow new records, then you will need to change that Record Source so the new record * indicator shows.
    Out of ideas at this point.

  • Object class deployment - Basic form question

    OK, I subclass calendar object from Oracle provided standard
    object class. What do I need to deploy to use this form now
    apart from calendar.pll and my fmx. What about the object class
    from which I sub-class. Do I need to compile and deploy that
    also? How will form resolve this on run time the parent object
    class as I really did not copy, just sub class and we do not
    deploy original class? Basic form question. Thanks.

    You can set the "help" property on the field (which gives you the little "information" icon link beside the field).
    You could also try adding another field of another class above or below:
    <Display class='InlineAlert'/>
    <Display class='ErrorMessage'/>
    <Display class='HtmlPage'/>
    ..etc
    -Rob

  • Populateing a drop down list in a repeating sub form

    I have been using the scripts from the Purchase Order sample that work with the Country and States/Provinces drop down lists and have modified them to fit my needs. The scripts work great. However I have a drop down list that is in a repeating sub form and the only the drop down list in the first occurance of the sub form works. The others don't.
    I put this line of code in a field called drpOrderedByTeam.
    JobsScript.getJobsOther(xfa, xfa.resolveNode("form1.TimeSheetSF.DetailsSF[*].DetailsTable.DetailsRow.ItemNumber"));
    I thought I just needed to add an "[*]" to the name of the sub form and it would work with all occurances but it doesn't seem so and I'm not sure what else to do.

    Based on your explanations, I've attempted to re-create your form and I think I've got it working the way you'd like it to.
    There are some difficulties with using fields in table headers which are replicated on subsequent pages because while new instances of the header subform and the fields it contains are created, you don't have access to these instances using the header's Instance Manager (I think this is a bug but I'm not sure). This means that you can't iterate through the instances of the header in order to populate the task lists depending on the selection in the team list. One solution for this is to make all header fields Global (select each field and, in the Object palette's Binding tab, set the
    Default Binding property to
    Global). This means that all instances of these fields will share the same value. The effect is that when you change the value of a field on an instance of a header on any page, the change will be replicated on all instances on all pages. The catch, though, is when you use lists in the header. Making list fields global doesn't mean that their item lists are global -- which causes other headaches.
    In the end, because of the problems I've described, I had to resort to cheating a little but if you think about it, it's not really cheating. What the form does is whenever the team list value changes, it removes all instances of the DetailsSF rows. This has the effect of also removing all instances of the DetailTitlesSF headers accross the current page set (and removes all pages but the first one). Then 6 new instances of the DetailsSF row are generated and the DetailTitlesSF header is re-populated using the new selection in the team list. After that, if a new page gets generated because of the number of instances of the DetailsSF rows, the new instances of the task lists in the new instances of the DetailTitlesSF header will have the correct list of items based on the current value of the team list. In the end, even though I'm cheating by removing all instances of the DetailsSF row in order to reset the lists in the DetailTitlesSF header, it's not really cheating because if you change teams, then it should be assumed that all data entered doesn't apply anymore because the tasks change as well... Convinced?
    The best way to understand this is to check-out the sample form.
    Let me know if you have any questions.
    Stefan
    Adobe Systems

  • Passing values to sub-forms  (Varaible scoping)

    I have a "parent" form that calls one of 6 subforms. I'm trying to figure out how to pass values derived in the parent to a sub form.
    I am running IdM 8.1.0.9 in glassfish 2.1.1. I set up these test forms to work through this:
    my Parent Form:
    <Form name='parent' objectLocationID='objectType=UserForm&objectName=parent&objectPath=0&isBegin=true'>
      <Display class='EditForm'/>
        <Include>
          <ObjectRef id='#ID#UserForm:child1' type='UserForm' name='child1'/>
        </Include>
        <!-- This value needed in child 1 form -->
        <defvar name='myvalue'>
          <s>test123</s>
        </defvar>
        <Field name='myfield'>
          <Expansion>
            <ref>myvalue</ref>
          </Expansion>
        </Field>
    <!--  My attempt at using <Variable>, IdM doesn't like this
        <Variable name='myextvar' external='true'>
          <ref>myvalue</ref>
        </Variable>
    -->
        <FormRef name='child1'/>
    </Form>
    my Child1 Form:
            <Form name='child1' objectLocationID='objectType=UserForm&objectName=child1&objectPath=0&isBegin=true'>
                <Display class='EditForm'/>
    <!--
               <Include>
                    <ObjectRef type='UserForm' id='#ID#UserForm:parent' name='parent'/>
                </Include>
    -->
                <Field name='subtext'>
                    <Display class='Text'>
                        <Property name='title'>
                            <concat>
                              <s>pre1:</s>
    <!--  
                               <FieldRef objectLocationID='objectType=UserForm&objectName=marty&objectPath=0&isBegin=true' name='myvalue'/>
    -->
                               <ref>myvalue</ref>
                              <s>:1post</s>
                            </concat>
                        </Property>
                    </Display>
                </Field>
            </Form>I was hoping that child forms would share the scope of the parent, and I could just use a <ref> tag in the child form, but that doesn't seem to work. So I started looking at FieldRef/FormRef but I'm not sure they are the right answer either.
    When the include in the child form is uncommented, I get :
    An unrecoverable error has occurred processing the request. Contact your system administrator.
    Syslog ID = LG-0405-115539.
    I'm guessing that this is because I include a form that includes this form, and created an endless include loop?
    When the FieldRef is uncommented, I get this error:
    Attruibute "objectLocationID" must be declared for element type "FieldRef".
    The <Variable> tag (defined as external) looks promising, but I haven't run across a good example of how to use it.
    When I try to add a <Variable> to my parent form, I get the error: Content of element type "Form" must match...
    This doc: http://docs.sun.com/app/docs/doc/820-5821/bvaex?a=view
    says that <Variable> is a valid form element, but IdM disagrees.
    Any suggestions on how to achieve the passing of values from one for to another would be greatly appreciated.
    -mk
    Edited by: mk152556 on Apr 5, 2010 6:27 AM

    An advice I usually follow: Skip defvars and variables, and stick to fields, hidden, not using any Display class that is, if you just need to use the field as an variable. Field are a lot more practical IMHO.

  • Master-Detail Form Questions

    Master-Detail Form Questions
    I have two questions in regards to master-detail forms:
    First, the form I am working on has 25 detail rows displayed to the user. If the user has more than 25 detail records for the master, I want them to be able to add more. For instance, after they enter the 25th record, I would like a pop up window to ask them if they would like to add more detail records for this master. If they select yes, then the records they have entered would be saved and then the form would repopulate with the current master record and another empty 25 detail records.
    Second, I would like the Detail Action to be set to Insert if the user moves to a new detail row and selects an item from a combo box.
    Thanks for any and all help.
    Jeremy.

    Hi Sharmila.
    Is there a way to repopulate only the Master information without populating the detail after the 'Save' button is pressed? I have written code that uses the session variables and repopulates the form with all the data that has just been saved, but I need only the master without the detail.
    Thanks.

  • Using another Type of forms

    I use JDeveloper 10.1.3.1 for my SOA project. Dose human task limited to JSP forms and I have to use only JSP forms? How can I use another type of forms like aspx forms? If it allows using multi type forms what I must do for that?
    Thanks.

    Good question fro another forum. BPEL: BPEL
    Frank

  • Pending commit on sub form

    Hi,
    I have a main form which enables user to calls another form to insert data in a table, after the user finishes the work on that sub form, he will return back to the main form.
    Is there a way that I make the DML happened on that sub form only committed if the user hit the save button on the main form?
    thanks,

    Not possible, due to the When commit is executed?.
    Instead, retain the sub form data temporarily in session state or collections, and process it when the main form is saved.

  • Focusing on fields between sub forms

    Dear All,
    We have to focus on some text field which is in a sub form when we click on some button. Like that we may have any no of sub forms, we have decide which subform field will be focused when click on a button. The xfa.host.setFocus is not working properly, its working only when we are in same subform. For example we have four subforms and in each sub form we have some fields. When we click on a button by observing the value in a textfield of a sub form we have set the focus on another textfield which is in another subform. Any help regarding this appreciated.
    Thanks,
    Nagesh

    Are you passing fully qualified SOM expressions to the setFocus method? ie, something like this:
    xfa.host.setFocus("xfa.form.formName.pageName.subformName.fieldName");
    H.

  • Master/sub form using JSP

    HI :
    i am working in an JSP project as my first real start
    i have an master form and there is an related form (the same concept as in oracle).
    and i need to make update to any filed weather it where in master form or sub form i can do that by insert update button , but the problem is that i need to make on each (master / sub form) an update button and this is not effictive way.
    so can i make just one update button which can make any update to any field weather it where in master or sub form .

    Hi Simon,
    Use form then Master Detail Form.
    You can insert, delete, and update rows.
    http://htmldb.oracle.com/pls/otn/f?p=26372
    for example of Master - Details - Details solution (not a form).
    Konstantin

  • Sub form not working when converted from adp to accdb

    Hi,
    We have migrated MS access 2003 (.adp) applciation to MS access 2010(.accdb). There are few functionalities in the application not working as expected. A form opens on a button click has two sub forms. Applications throws error when button is clicked. run
    time error 2467. The expression you have entered refers to an object that is closed or doesnt' exist.
    Form_frmmainform.frmsubform.Form.RecordSource = rs
    Main form contains sub form and that has another sub form within in. There was a query for the record source whcih ihave replaced with recordset.
    But it works fine in .adp version. Could any body help me in this regard
    Thanks in advance

    Hi All,
    Could somebody please help me in this regard.
    We have migrated MS access 2003 (.adp) applciation to MS access 2010(.accdb). There are few functionalities in the application not working as expected. A form opens on a button click has two sub forms. Applications throws error when button is clicked. run
    time error 2467. The expression you have entered refers to an object that is closed or doesnt' exist.
    Form_frmmainform.frmsubform.Form.RecordSet = rs
    Main form contains sub form and that has another sub form within in. There was a query for the record source whcih ihave replaced with recordset.
    But it works fine in .adp version. Could any body help me in this regard
    Thanks in advance

  • Another Unlimited Data Upgrade Question

    (Yes, it's another one of those questions.  I'm sorry, but searching - on here, or on Google - only left me with conflicting information.)
    Here's my question:
    A friend of mine is interested in selling me his Galaxy Nexus phone.  Would I be able to keep my single-line, grandfathered, unlimited data plan if I buy his phone and switch to it, or is that only possible if I were to buy the phone new, directly from Verizon?
    Here's my story:
    I have an HTC Thunderbolt that I purchased when it launched.  A few months after buying it, it turned into the HTC Bad Dream, and now it's the HTC Nightmare.  Random heat issues, battery draining, random reboots... It's the same song and dance we've heard before.  These are design issues with the phone; not something a replacement or a repair would fix.
    The real annoyance, though, is the mobile hotspot.  I pay $30/month to use the hotspot legitimately, unlike the users who root their phones to use it without paying for the option, but ever since Verizon started blocking the third-party wireless tethering apps, I've had to choose between using the stock mobile hotspot app and unleashing the above-mentioned Phonemageddon, or simply going without.  I could drop the option from my plan, but seeing as the unlimited data plan no longer exists, I wouldn't be able to get it back without switching to a tiered or shared plan.
    Switching to a more stable phone would alleviate my issues, hopefully, but the difference between Verizon's retail prices and other retailers is hundreds of dollars.  Giving up my unlimited plan, however, wouldn't make the venture worth it.  A definite answer to the question of buying used - either from a Verizon representative, or a customer who's been in the same scenario before - would be very helpful.
    Thank you very much.

    Hi,
    If you provide your own equipment (your friend's Nexus or from ebay etc) then YES you can keep unlimited data. Another wayto keep unlimited would be to pay full retail for a new phone. But I'm sure your friend will give you a better deal than that
    Hope that helps!

  • Open a form as a pop up (sub form)

    In Dreamweaver 8, how do I open a form as a pop up (or sub form)?
    On a form users will be able to select an item. When they do I want to open a form, on top of the form that the user made the selection, and display information about their selection.
    Many thanks in advance

    Once again... jQuery to the rescue!
    http://www.ericmmartin.com/simplemodal/
    Look at the pop up form demo - the second one down.
    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF

  • Form Designer Form. Is it possible to delete a form after it is created?

    Hi
    Is it possible to delete a form once its created in the system?
    Regards Glenn

    GlennA wrote:
    Hi
    Is it possible to delete a form once its created in the system?
    Regards GlennIn case you are interested, following can be done at database:
    Say, if you want to delete UD_ABC form (Process Form/Object Form/Parent Form/Child Form)
    delete from FUG where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from OSI where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from UNM where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from MSG where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from MST where MIL_KEY in (Select MIL_KEY from MIL where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC'));
    delete from RML where MIL_KEY in (Select MIL_KEY from MIL where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC'));
    delete from RSC where MIL_KEY in (Select MIL_KEY from MIL where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC'));
    delete from MIL where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from ODF where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from OIU where ORC_KEY in (Select ORC_KEY from ORC where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC'));
    delete from ORC where TOS_KEY in (select TOS_KEY from TOS,SDK where TOS.SDK_KEY = SDK.SDK_KEY and SDK_NAME = 'UD_ABC');
    delete from TOS where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from SDC where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from SDL where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from RAV where SRE_KEY in (select SRE_KEY from SRE,SDK where SRE.SDK_KEY=SDK.SDK_KEY and SDK_NAME='UD_ABC');
    delete from SRE where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from SDK where SDK_KEY in (select SDK_KEY from SDK where SDK_NAME='UD_ABC');
    delete from WIN where WIN_KEY in (select WIN_KEY from WIN where WIN_WINDOW_NAME = 'tcfrm' || 'UD_ABC');
    delete from SEL where DOB_KEY in (select DOB_KEY from DOB where DOB_NAME LIKE '%UD_ABC');
    delete from DOB where DOB_NAME LIKE '%UD_ABC';
    drop table UD_ABC;
    Disclaimer: Oracle does not recommend deleting forms.

Maybe you are looking for

  • I have an ipod nano that is not recognized by my mac

    I have an ipod nano that i bought years ago and I origanly had it sync to a old computer that was stollen! I am now trying to sync it to my new mac but the computer dos not recognize it.

  • Can't move messages in Mail Inbox to Trash

    When I try to empty my unwanted Inbox messages into Trash I get the following window opening in Apple Mail: "6593.emlx" couldn't be copied to "Messages" because an item with the same name already exists. The same applies whether I go for Select All o

  • UCS Management Pack for System Center 2012 OpsMgr add monitor wizard error

    We're successfully using the 2.6.0.179 version of the UCS Management Pack for System Center 2012 Operations Manager in our 2012 SP1 OpsMgr environment; however, in the new 2012 R2 OpsMgr environment we've stood-up and in which we installed the 2.6.2.

  • Group Mailer error

    Hi I am trying to set up a workflow to simply send the same email newsletter to a group in the address book. The workflow looks like this: New mail message Find groups in Address Book Group Mailer Send outgoing messages Everything works until the Gro

  • 11ginstall.sh  and Oracle 11.2 RDBMS media

    Hello I would lik to install an SAP ECC 5.0 system Linux(last Red Hat)/Oracle (we have to move there existing system on Alpha TRU64 in order to upgrade it) The wish is to install Oracle 11 supported by 640_EX2 kernel. I went through notes : Note 1431