Include Approval Status from Sharepoint Document Library as a read only value in my Infopath form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Include Approval Status from Sharepoint Document Library as a read only value in my Infopath form

Last post 05-02-2008 09:03 AM by Catharine. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-07-2008 10:21 AM

    Include Approval Status from Sharepoint Document Library as a read only value in my Infopath form

    Hi - I am using Infopath 2007.

    I would like to display the Sharepoint status and version on my infopath form.

    I have set up a secondary data source to collect that information for the current form. - This creates a repeating group.  (But I should only ever have one value in it - as I have chosen current form)

    I have a repeating section in my form which displays the data.

    BUT the Approval status sent is a number....  I know that 0 = Approved, 3 = Draft etc.

    I have tried to 'decode' the approval status into a field in my main data source by setting  a field value = Draft if max(@Approval_Status) = 3 this did not work

    So I created a field and set the default value to max(@approval_status) - ie no decoding to words..... and that does not work either - I get a blank field

    I have also tried setting it to @Approval_Status and still get a blank - yet I can see on my form the fields from my secondary data connection - and the value is 3 

    I am obviously missing something - can someone point me in the correct direction ?

    In my ideal world I would like to create one field which concatenates the Sharepoint version number with the 'decoded' approval status just for display 

    Thank you

    Catharine

  • 05-01-2008 12:43 PM In reply to

    • fstemp
    • Not Ranked
    • Joined on 05-01-2008
    • Atlanta, GA
    • Posts 1

    Re: Include Approval Status from Sharepoint Document Library as a read only value in my Infopath form

    I having the same issue and not having much luck in finding a solution.  Any and all help is greatly appreciated :)

  • 05-02-2008 09:03 AM In reply to

    Re: Include Approval Status from Sharepoint Document Library as a read only value in my Infopath form

    I am glad that someone else wants to do the same.... to me it was an obvious requirement.  I am afraid I did not have much luck with pulling the data directly from the secondary data source just using the fields in InfoPath.    I have written an on load event which does what I want to in code (VB) - I am no expert at this and it may not be pretty but I have got it to work.  I have also managed to pick up the modified by and modified date in the same way.

    I have a field in my main data source, DecodeStatus

    I have a secondary datasource, FRMProperties - which collects properties of the current form (there is a check box to select this when creating data source)

    In Code - Form Load event

    Dim Nav As XPathNavigator = Me.CreateNavigator.SelectSingleNode("/my:myFields/my:ZCalculationFields/my:DecodeStatus", NamespaceManager)

    Dim SDs As DataSource = Me.DataSources.Item("FRMProperties")
    Dim SNav1 As XPathNavigator = SDs.CreateNavigator.SelectSingleNode("/dfs:myFields/dfs:dataFields/dfs:DataPrivForm/@Approval_Status", NamespaceManager)
    Dim SNav2 As XPathNavigator = SDs.CreateNavigator.SelectSingleNode("/dfs:myFields/dfs:dataFields/dfs:DataPrivForm/@Version", NamespaceManager)

    Dim stattext As String = "PreSubmitStatus"

    Try

    Dim stat As String = SNav1.Value
    Select Case stat
    Case "0"
    stattext = "Approved"
    Case "1"
    stattext = "Rejected"
    Case "2"
    stattext = "Pending"
    Case "3"
    stattext = "Draft"
    Case "4"
    stattext = "Scheduled"
    Case "5"
    stattext = "xxxxx"
    End Select

    Try
    Dim statver As String = SNav2.Value
    stattext = statver &
    " "& stattext
    Catch ex As Exception
    End Try

    Catch ex As Exception

    End Try

    Nav.SetValue(stattext)

     

     

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