Query List/Library using Code on a Web-Enabled Form - InfoPath Dev
in

InfoPath Dev

Query List/Library using Code on a Web-Enabled Form

Last post 05-31-2011 11:20 AM by w2truong. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-31-2011 11:20 AM

    Query List/Library using Code on a Web-Enabled Form

    So here is the situation, I have a SharePoint library of external content types which have a series of fields. Users are allowed to create new entries using a Web-Enabled InfoPath Form through SharePoint in a browser. But before the entry is created, it has to be cross-referenced with the library to make sure there are no conflicting schedules etc. There are three criteria: one is location, one is a datetime range (start date and end date) and the last is a series of numbers. The series of numbers is a repeating text field so when it is stored in SharePoint, it formats using space delimiters (i.e. "1 2 3"). I am using a Secondary Data Source to connect to the SharePoint library.

     I was able to successfully implement the first two criteria (location and datetime) using Default Value section and Insert Formulas (sample below):

    Created[WorkAddress = Address and ((msxsl:string-compare(Event_Start_Date, addSeconds(_x007b_3db7d1b0_x002d_8673_x002d_4340_x002d_94e2_x002d_85023c183f1f_x007d_, -1800)) = -1 and msxsl:string-compare(Event_End_Date, addSeconds(_x007b_3db7d1b0_x002d_8673_x002d_4340_x002d_94e2_x002d_85023c183f1f_x007d_, -1800)) = 1) or (msxsl:string-compare(Event_Start_Date, addSeconds(_x007b_3db7d1b0_x002d_8673_x002d_4340_x002d_94e2_x002d_85023c183f1f_x007d_, -1800)) > -1 and msxsl:string-compare(Event_Start_Date, addSeconds(_x007b_3251b4e2_x002d_94b0_x002d_4f65_x002d_a2a1_x002d_3f9a76dc7cba_x007d_, 1800)) = -1))]

     Can anyone think of a way for me to implement the last criteria, the series of numbers?

    Thank You,

    p.s. my description might be a little unclear so i will be glad to clarify if needed

    p.s.s. if my default value formula returns multiple rows/values from my Secondary Data Source, is there a way for me to count/display the number of rows/results returned? I know that it will only display one result in the field, but it would be nice to know if there were actually multiple results.

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