How to get all the values from the Contact Selector control to be used in SharePoint Workflow? - InfoPath Dev
in

InfoPath Dev

How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

Last post 05-31-2009 08:44 AM by warrtalon. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 05-29-2009 10:27 PM

    How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    Hi,

    I am using contact selector and when I try to access the value in SharePoint workflow using Visual Studio i get the error as:

    Namespace prefix 'my' is not defined.

    Below is the code that I am using to get the values from the contact selector.




    try
    {
    SPFile file = workflowProperties.Item.File;
    if (file == null)
    return;
    byte[] xmlFormData = file.OpenBinary();
    XPathDocument ipForm = null;
    using (MemoryStream ms = new MemoryStream(xmlFormData))
    {
    ipForm = new XPathDocument(ms);
    ms.Close();
    }
    if (ipForm == null)
    return;
    XPathNavigator ipFormNav = ipForm.CreateNavigator();
    XmlNamespaceManager nsManager = new XmlNamespaceManager(new NameTable());
    XPathNavigator nodeNav = ipFormNav.SelectSingleNode("/my:myFields/my:group9/my:Person/my:DisplayName", nsManager);

    }
    catch (Exception ex)
    {


    }

    I want to achive the following.

    1. get the values present in the contact selector (the values are more than one : more that one people are selected in that control)

    2. send an email to all the people present in the control (more than one)
     
    Thanks
    Sumeet Gandhi

  • 05-30-2009 02:39 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    Hi,

    Use ‘this.NamespaceManager' instead of 'nsManager'.

    XPathNavigator nodeNav = ipFormNav.SelectSingleNode("/my:myFields/my:group9/my:Person/my:DisplayName", this.NamespaceManager); 

     

    Rajitha
  • 05-30-2009 04:49 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    Rajitha:

    Hi,

    Use ‘this.NamespaceManager' instead of 'nsManager'.

    XPathNavigator nodeNav = ipFormNav.SelectSingleNode("/my:myFields/my:group9/my:Person/my:DisplayName", this.NamespaceManager); 

     

     

     

    Hi Ranjitha,

     Thanks for the reply. I tried to implement that you said " this.NamespaceManager" but it is not available for me to be used. Any Idea what may be wrong in this. Kindly see the code that i am trying to use. I am looking for a way by which i should be able to get all the values present in the Contact Selector Control (more than one).

    If you can guide me in this I would be glad.

    Thanks

    Sumeet Gandhi

  • 05-30-2009 07:25 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

  • 05-31-2009 03:43 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    warrtalon:
     

     

    Thank you very much for the help. I did that with the code as this codeless method was not working in my case properly.

  • 05-31-2009 03:44 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    Rajitha:

    Hi,

    Use ‘this.NamespaceManager' instead of 'nsManager'.

    XPathNavigator nodeNav = ipFormNav.SelectSingleNode("/my:myFields/my:group9/my:Person/my:DisplayName", this.NamespaceManager); 

     

    Thanks,

    I have completed that and now looking at some different thing. I have posted that as a new entry. Kindly see and do let me know your valuable comments.

  • 05-31-2009 08:44 AM In reply to

    Re: How to get all the values from the Contact Selector control to be used in SharePoint Workflow?

    It does work if you do it right, is very simple, and doesn't require full trust on the form when complete.

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