So close but need help comparing strings in different subforms with for loop - Livecycle ES

For some reason I was not able to post this in the Livecycle ES forum, even though I've posted there often in the past.
I have created a form that I almost have working and I'm hoping someone can help me.
We have eight billing teams in our company and each team works anywhere from 1 - 4 different clients. The form is used to track, per Billing Rep, the number of items of mail that each billing r5ep works each day. What I'm needing to add at the bottom is a subform that tracks the totals by client. So I'm trying to get the form to loop through all of the existing subforms (and the subforms within them) and compare a cell int he bottom subform to a cell in the other subforms, which are dynamically added, and then total ONLY those items. My script however is not working.
What I have now is:
var repCount = form1.P1._rep.count
var itemCount = form1.P1.rep._ItemSet.count
for (x=0; x<repCount; x++)
     for (i=0; i<itemCount; i++)
          if(clientName.rawValue == P1.rep[x].ItemSet[i].client.rawValue)
          this.rawValue = this.rawValue + P1.rep[x].ItemSet[i].corresp.rawValue;
It seems like this should work but I'm getting the following error:
P1.rep[x] is undefined
So what it looks like is I'm missing is the proper way to reference the objects in these subforms.
The form is here: https://acrobat.com/#d=20gWXZ4sBm4OPV6oO76zSg
If someone could take a look at it I would be so grateful.
Thanks,
Jo

I don't know that anyone else will ever have a similar problem as what I was having, but I figured I would go ahead and post the solution, just in case....
The error I was getting (P1.resolveNode("rep[" + j + "].ItemSet[" + i + "]") is null) was occuring because the variable itemCount needed to be referenced within the repCount For Loop. I also needed to resolve the node for the itemCount, which I wasn't doing.
So...my old code was this:
var repCount = P1._rep.count;
var itemCount = P1.rep._ItemSet.count;   //this part was throwing the error. Needed to use resolveNode...and needed to not declare the variable until inside the first For Loop.
var nTotal = 0;
for (var j=0; j<repCount; j++) {
    for (var i=0; i<itemCount; i++)    {
        if (P1.resolveNode("rep["+ j +"].ItemSet["+ i +"]").client.rawValue == clientName.rawValue) {
            nTotal = nTotal + P1.resolveNode("rep["+ j +"].ItemSet["+ i +"]").corresp.rawValue;
this.rawValue = nTotal;
...which wasn't working because it was trying to reference the count of the ItemSet right up front...but it needed to wait until it got inside the first iteration of the repCount subfields...AND it needed to have resolveNode used.
The corrected code is:
var repCount = P1._rep.count;
this.rawValue = 0;
for (var j=0; j<repCount; j++) {
    var itemCount = P1.resolveNode("rep["+j+"]")._ItemSet.count;  //corrected code...node is resolved and variable is declared within the first subform repCount.
    for (var i=0; i<itemCount; i++)    {
        if (P1.resolveNode("rep["+ j +"].ItemSet["+ i +"]").client.rawValue == clientName.rawValue) {
            this.rawValue = this.rawValue + P1.resolveNode("rep["+ j +"].ItemSet["+ i +"]").corresp.rawValue;
...which now works perfectly...and I'm throwing a party to celebrate! LOL
Jo

Similar Messages

  • HOW TO?: Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Need help setting up 3 different iCloud accounts for my kids (so each has own iMessanger)using same Apple ID (mine) ....they don't have their own separate email addresses to work from...how do I do this?

    Any devices connected to the same icloud account can sync all the data on that account.  For this reason an icloud account is really for a single user.
    On a mac, if each user has their own account, then the itunes for that mac account should be set up to connect to that user's icloud account (System preferences>icloud).

  • Compare string in different line in text file

    I am new to java and I need a simple example to compare string in file text by for loop
    file.txt:
    A78802 D06VAIS060253113 WKNEUP751346577450
    A77802 D06VAIS060253113 WKNEUP751346577450
    A76802 D06VAIS060253925 WKNEUP751346577450
    A78802 D06VAIS075253698 WKNEGE226375082796
    A73802 D06VAIS116253222 WKNEFB227345305299
    dataString = TextIO.getln();
    A=dataString.substring(25,42);
    B=dataString.substring(195,203);
    C=dataString.substring(171,186);
    I WANT COPMPARE IN LINE 1 POSITION 20 TO LINE 2 POSITION 20 BY LOOPS ALL THE LINE IN TEXT FILE

    what have you tried so far?
    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
    &#91;/code]

  • Need help in String operations

    HI all,
    I need help in String operations.I am getting file path of an image as
    c:\test\img\abc.gif"
    I need to convert it in to c:/test/img/abc.gif".
    Can any one suggest the solution for this.
    Thanks,
    Durga.

    [email protected] wrote:
    I used String replace method but I am not able to do it because "/" is a special character."/" is not a special character, "\" is a special character, which needs to be escaped by "\" itself.

  • I am new to this but need help. Lion and iCloud have never worked on my desk top or MacBook Pro.  Slow or Stop!  Is there any way to fix the problem?

    I am new to this but need help. Lion and iCloud have never worked on my desk top or MacBook Pro.  Slow or Stop!  Is there any way to fix the problem?

    We need more information. I'm not sure what you mean by both Lion and iCloud have never worked.

  • HT201269 I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone I purchased 2 weeks ago when my Iphone was stolen. I don't know how to get the money or music on new phone?

    Need help with Itunes transferrs and can I use my Edge phone as a router?

    I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone
    Is this an iPhone?
    Set it up using the AppleID you used on the previous iPhone.

  • Hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    hii i need help i cannot use my apple id for download on app store because they say i need to verify my account but i don't know how so please somebody can help me? i try to resset my password but that don't help

    is it asking for ur security questions?

  • I am un able to send mail as it gets stuck in my outbox. I am sure the solution is simple but need help?

    I am un able to send mail as it gets stuck in my outbox. This is a recent phenomena. I am sure the solution is simple but need help?

    I looked everywhere for a solution - and I finally figured it out! Deleting my accounts didn't work, but here is what worked. This worked when my Gmail accounts were not sending properly. I'm not sure if it works for other e-mail services.
    1. While in Mac Mail, click "Mail" in the top left corner of the screen
    2. Click "Preferences"
    3. Click "Accounts"
    4. Select your account that isn't sending properly
    5. In "Outgoing Mail Server (SMTP)" there will be two options - Gmail & Gmail (offline)
    Make sure that "Gmail" is selected and NOT "Gmail (offline)"
    If you navigate to another section in Preferences, it will ask you to SAVE - make sure you save your changes!
    It worked for me, hope it works for you!

  • Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help.

    Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help. Can someone give me some direction ?

    jpatricio787 wrote: ... is it possible to use it with my white MacBook ?...
    OK so yes, but if, and only if:
    (1) your MacBook has a Firewire port (not all do)
        - and -
    (2) your old external iSight camera works (not all do)
        - and -
    (3) your MacBook is working properly.
    If you are not certain whether your MacBook model has Firewire, you can search MacBook Technical Specifications for your model.  Alternatively, check the  User Guide Manual that came with your MacBook for the information you need to be certain.
    If you are not certain that your old external iSight camera works, you can test it using the suggestions in this link.
    jpatricio787 wrote: ... if so how do I go about it ? ...
    Follow the instructions in your iSight User's Guide to connect and turn on the iSight.  Then launch the Apple app you want to use with your iSight.  If you need more information about using an app, search for "camera" (without the quote marks) in the Help menu choice for the app.
    jpatricio787 wrote:... Can someone give me some direction ?
    If you need more direction, post back the specifics of what you still need.  We will offer further direction based on the details of your reply.
    Message was edited by: EZ Jim
    Mac OSX 10.9.3

  • Purchasing MBA but need help on upgrades.

    Hello, I am purchasing an MBA, but need help on upgrades based on the following; I will be attending medical school in the fall, I take a wide range of photos of my family on my iPhone that I play with on certain apps and do store them in the cloud and computer, I have a medium iTunes libaray but will get bigger with the additional apps for school, I am a moderate gamer (I play games online as well as my kids do, but nothing that will take up a ton of space when downloaded like Assassins Creed) and I plan on running MS Office. I've already decided to upgrade to the 8GB but I can't decide if I should upgrade to the 512GB Flash or stay with the 256GB and upgrade from the i5 to i7 or stick with it. I don't plan on buying another until I graduate. I am new to the Mac World outside of the use of my iPhone which convience me to convert from my awful PC. Can you MBA experts relay some advice on a good route. I appreciate it, Thanks

    My rule of thumb is to buy the largest drive storage available. Especially since the Air models can't be upgraded to a larger size in the future. I also like to buy the most amount of RAM offer and as with the storage space on the Air models can't be upgraded once purchased. So Bite the Bullet and spend the money to get both the most RAM and the largest storage offered as neither can be increased later on.  Also I suggest you spend the extra money on the Applecare extended warranty because to fix any Mac once the standard warranty is over is very expensive. You have until the one year standard warranty runs out to buy the Applecare extended warranty.

  • All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so it goes to Default. thanks

    All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so all photos goes to Default or as shot. thanks

    Go to the develop module and highlight all of the images in the filmstrip at the bottom of the screen. Then activate Auto-sync and click on the Reset button. That should reset all of the images to your camera default settings.

  • Need help using WEB module in Lightroom 2 for .mac/mobile me accounts

    Hello,
    I need help in finding the Server path information for Lightroom 2.  I am trying to use the Web module of Lightroom and build a website and instead of going through another hosting service, I want to use my Mobile ME account, can't I do that?
    I have the user name and password obviously but what is the server path, protocol, path?
    Help please!
    Thanks
    Ray

    For those Mac Users using iWeb, MobileMe, and Lightroom 2, here are step-by-step instructions on how to create a web gallery in Lightroom, upload the gallery to MobileMe, and finally, how to link the uploaded files to the wesite you created in iWeb.
    1. In the Lightroom Library module, create a collection of photos you want to display in your web gallery.  For illustration purposes, we will call your collection Sunsets.  Once created, it will be listed under Collections in the left panel of Lightroom.
    2. Switch to the Lightroom Web module and select the Sunsets collection (from the panel on the left of the screen.)
    3. Chose whichever template you like (from the list of Templates in the left panel).
    4. Fine tune the appearance of the gallery using the controls in the right hand panel of Lightroom 2.
    5. When you are satisfied with the gallery’s appearance, use your keyboard to type Command-S.  That will save your template settings (give it a unique name when saving).
    6. Open up Finder on your Mac.  Inside your username folder, create a new folder… I'll call it Web Files.  (You can choose any name you like, and locate the file anywhere on your Mac HD.)  You have just created the folder username/Web Files.
    7. Back in the Lightroom Web module, chose Export, at the bottom of the right panel, and export your gallery to the folder you just made (e.g. export to username/Web Files).  By doing so, you will have created /username/Web Files/Sunsets.
    8. Once again open Finder on your Mac.  Go to /username/Web Files/Sunsets and you will see 3 files in the Sunsets folder: bin, index.html, and resources.
    9. Open a second Finder window and in it, click on your iDisk icon.  You will soon see all of the files on your iDisk.
    10. In iDisk, click on the folder called /Web.  You will now see the /Sites folder inside the /Web folder.  I.e., /Web/Sites.
    11. Drag the Sunsets file from your Mac HD to the /Sites folder on your iDisk.  E.g, drag Sunsets from /username/Web Files/Sunsets on your Mac HD to the /Sites folder in iDisk /Web/Sites.  The Sunsets folder (and the three files it contains) will now upload to your iDisk on MobileMe.
    12. Open iWeb on your Mac. Add a new page to your website.  Call it “Galleries,” or anything you like. (You can also use an existing page if you wish.)
    13.  On that “Galleries” web page (or on an existing web page), create a picture icon, or a word, or a symbol, or anything else that you will activate as a hyperlink to your iDisk web files - specifically, you will link it to the Sunsets folder you just uploaded to iDisk.
    14. Activate the hyperlink in iWeb’s Inspector.  In the URL box, type:
    http://web.me.com/username/Sunsets  (Don’t forget to substitute your name for “username” and the name of your gallery for “Sunsets.”)
    15. Save your website in iWeb, and then publish your site.
    You will NOT see your gallery in iWeb – you will see only the link to the gallery that you uploaded to iDisk..  To view your gallery, either make hyperlinks active, using the Inspector in iWeb and click on he link to the gallery, or visit your website on the internet.  If you want to edit your gallery, you will have to do that in Lightroom… then repeat steps 7 – 11.  You cannot edit your gallery in iWeb, but you can use iWeb to change the appearance of the link to your gallery, or to change it’s location within your website.

  • I need help exporting Apple Mail messages to Outlook for MAC 2011

    Good morning,
    I need help exporting Apple Mail messages to Outlook for MAC 2011. Please....

    It is possible to do this without external tools, but it is a tremendous faff. See
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macoutlook/import-ema il-from-mail-to-outlook-2011/5e858173-e1f4-4adc-99d7-253cc467169d?page=2 for details.
    The easiest way, however, is to use Mail Exporter Pro https://itunes.apple.com/us/app/mail-exporter-pro/id675131616?mt=12 which will convert the email for you from one format to the other, and comes with an excellent manual.
    A third possibility is to connect Apple Mail to an email account via IMAP (this doesn’t have to be your usual account, you can just create a Gmail account for the purpose) . Copy all the messages into it and they will be uploaded. Then connect Outlook 2011 to the same account, via IMAP again, and let the messages download, then copy them to wherever you want to keep them and disconnect from that account. This is slow but preserves the attributes of your email (e.g. read/unead) better than any other method.

  • Need help . Bought original HP 21b ink for F370 all in one printer , its not printing

    Hi , 
    Need help . Bought original HP 21b ink for F370 all in one printer , its not printing at all .Kindly mail at [Thank you for visiting the HP Support Forums. I am sorry to inform you that your post has needed some editing to remove personal information.]
    . Thanks .

    Hello @Bn23 , and welcome to the HP Forums, I hope you enjoy your experience!
    I see you're running into print issues.  I would love to try and help you, but I do need a little information first. I am linking a few HP Support documents below that will show you how to find which operating system you are using. Also, if you're using Windows, please include whether your operating system is 32-bit or 64-bit. With this information we can provide you with accurate information.
    Mac OS X: How Do I Find Which Mac OS X Version Is on My Computer?
    Which Windows operating system am I running?
    Is the Windows Version on My Computer 32-bit or 64-bit?
    Also, when you print, does a blank page come out, or does no paper feed through the printer?  Is there any errors that come up?
    Please let me know what you find.  Thanks for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Need help! Can't validate date overlaps for a tabular column

    Hello all,
    The validation I created to validate whether new or updates rows does not overlap with any records in the table isn't working.
    The columns are StartDt and EndDt
    Validation Type: NOT EXISTS
    Validation expresion:
    select 1
        from  sample S
        WHERE S.STARTDT BETWEEN :STARTDT AND :ENDDT
    OR(S.ENDDT BETWEEN :STARTDT AND :ENDDT)
    or (S.STARTDT <= :STARTDT and S.ENDDT >= :ENDDT)
    or (:STARTDT <= S.STARTDT and :ENDDT >= S.ENDDT)
    Error Message:
    Times overlap
    When Buttons pressed
    -Select Button-
    The validation works if a new row or updated row overlaps any existing start and end date records but it doesn't work if I update startdate and end date rows that doesn't overlap existing date times
    Example:
    TABLE DISPLAYS THE FOLLOWING RECORDS
    NAME                   START DATE                      END DATE
    TEST                    1/1/2012                               12/31/2012
    If I update the rows to the following values, I receive an error message (although those values don't overlap any records in the table)
    NAME                   START DATE                      END DATE
    TEST                    6/1/2012                               10/30/2012
    Any ideas? Do I need to change my code?
    Click the link to view the answer to this question. Need help! Can't validate date overlaps for a tabular column
    Message was edited by: CharlieMack

    Logic for date range overlap testing only requires two conditions in the WHERE clause:
    ORACLE-BASE - Overlapping Date Ranges
    WHERE S.STARTDT <= :ENDDT AND S.ENDDT >= :STARTDT -- TRUE for ranges that overlap
    It looks a little odd, but, if you scribble out a 'logic table', it makes sense.
    Condition
    A.start <= B.end
    A.end >= B.start
    A__A B--B
    true
    false
    A__B=A--B
    true
    true
    A__B==B__A
    true
    true
    B--A==B__A
    true
    true
    B--B A__A
    false
    true
    MK

Maybe you are looking for

  • Office 2013 crashes when trying to access MS query

    Hi, I am having a problem with Microsoft Excel 2013 (32bit) running on my Windows 7 64bit machine. I cannot get data from a Microsoft query. When I click on this button it instantly freezes and hangs with the message "Waiting for data to be returned

  • Adding a record in a database using the jbutton

    hi i'm a newbie of jdeveloper.. i just wannna ask how to code adding a record in a database POSTGRESQL using the jbutton.. i already connected in the database but in the model form it has already navigation buttons.. but i want to learn how to code t

  • Using QT Pro for TV commercial

    Initially, I thought my question would be a common one for this forum, but I searched and haven't found the answer. I would like to email a Quicktime movie – a TV commercial – but the file I have is too large. Currently the file is 156MB, DV/DVCPRO –

  • Does a table/view still return records if the underlying VPD policy fails ?

    Hi All, I have one following question - Does a table or view still return records if the underlying VPD policy fails? I am adding one more thing here. Let us say security is being implemented using the application context and VPD. What would happen w

  • Windows tries to install Labview Run-Time Engine 7.0...

    I recently installed an application that installed Labview CVI Runtime engine.  Anyway, ever since that time, everytime I start Labview, Windows tries to install Labview Runtime engine 7.0.  It asks for a lvruntimeeng.msi file.  I tried pointing it t