Help with SortTable - InfoPath Dev
in

InfoPath Dev

Help with SortTable

Last post 11-12-2012 07:38 AM by Hilary Stoupa. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 11-08-2012 10:30 AM

    Help with SortTable

    I have created a repeating table, within a section, that I would like to Sort using SortTable. The Repeating Table was created by dragging the List from a Sharepoint List Secondary Connection. I therefore used the following SortTable command: SortTable /dsname=d:SharePointListItem_RW /row=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW /compare=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Unit The error is "Error: The specified secondary DOM is not present.". I also tried it without the d: (/dsname=SharePointListItem_RW) based on another post, but that didn't work either. Any suggestions?
  • 11-08-2012 10:36 AM In reply to

    /dsname is the name of your data connection. When you created the data connection to your list, what did you name it?
    Hilary Stoupa

  • 11-08-2012 10:46 AM In reply to

    Oh, I see. I changed it and got past that error. My new error is "Failed to select the comparison field: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Unit".
  • 11-08-2012 10:55 AM In reply to

    The /row should be relative and not include the leading slash. The /compare should be relative to the row:

    /row=dfs:myFields/dfs:dataFields/d:SharePointListItem_RW /compare=d:Unit

    for example...

    Hilary Stoupa

  • 11-08-2012 11:01 AM In reply to

    Worked great! Thank you very much, you guys are amazingly fast at helping us out!!!
  • 11-08-2012 11:42 AM In reply to

    One more question.....does this command support sorting a date field?
  • 11-08-2012 11:50 AM In reply to

    It would be sorted as text. XML dates are in this format: 2012-05-12 or 2012-05-16T12:34:56

    Dates from SharePoint are sometimes: 2012-05-16 12:34:56

    But they should sort as text without an issue, due to the format - does that make sense?

    Hilary Stoupa

  • 11-08-2012 12:32 PM In reply to

    Yes it does, thank you.
  • 11-08-2012 08:54 PM In reply to

    I decided to work on this report a little more at home, but I ran into a strange error. When I run the report and click the button that starts SortTable, I get an error: "An unhandled exception has occurred in the form's code. System.InvalidOperationException An error occurred in the form's rules or code. The number of rule actions or the number of calls to the OnAfterChange event for a single update in the data exceeded the maximum limit." After clicking OK I have to click OK about 10 or 15 times on "Some rules were not applied, Operation Aborted", it then does the original error again, then completes the sort. The sort button(s) I've created work fine after that. The only difference at home is that I'm running Windows 8. I will try it at work on a couple of machines to confirm its specific to my PC at home. Any other thoughts?
  • 11-09-2012 02:41 PM In reply to

    Don't know what caused this, but it happened at work as well. It was the initial stages of the form so I rebuilt it and its working fine again. Having a bit of trouble now adding a second compare. To clarify, would the portion of the command be /compare=d:/Building,d:/Unit?
  • 11-09-2012 02:44 PM In reply to

    Its all working now. Thanks
  • 11-12-2012 07:38 AM In reply to

    I know you've resolved this, but wanted to add some info for anyone else who runs into this. SortTable actually ends up deleting and re-adding the nodes after sorting - sometimes this can cause rules on those nodes to execute again (which can cause the looping error you've seen). I often add a node to an XML 2ds called "IsSorting" or something and use it as a conditional for rules on the nodes I'm sorting. I set it to true right before I execute my sort command then false afterward, and the rules on the nodes I'm sorting can have a condition of "IsSorting = false".
    Hilary Stoupa

Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.