Parent node Changed Event.. - InfoPath Dev
in

InfoPath Dev

Parent node Changed Event..

Last post 01-31-2013 12:16 AM by Ravik. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 01-25-2013 01:14 AM

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Parent node Changed Event..

    This is my very first post, so please excuse me if im not clear with my message.

    Well here is my question. If you can see the code below, what im trying to do is change the oldvalue to newvalue. but when i check my debug all i can see is "" to "NewValue". Not sure sure why system stores blank value instead of old value. Can someone guide me in this process please. Im new to InfoPath and coding. Thanks

    public

    void ActionAssigneeFormatted_Changed(object sender, XmlEventArgs e)

    {

    if (e.OldValue != e.NewValue && !string.IsNullOrEmpty(e.NewValue))

    {

    WriteToDebug(string.Format("Changing assignee from '{0}' to '{1}'", e.OldValue, e.NewValue));

    XPathNavigator action = e.Site.CreateNavigator();

    action.MoveToParent();

    XPathNavigator actionAssigneeChanged = action.SelectSingleNode("my:ActionAssigneeChanged", NamespaceManager);

    if (actionAssigneeChanged != null)

    {

    actionAssigneeChanged.SetValue(

    "1");

    WriteToDebug(

    "Assignee Changed");

    }

    }

    }

  • 01-25-2013 04:48 PM In reply to

    Re: Parent node Changed Event..

    Your old value is not blank? That is, I'd expect to see it blank if the field was blank prior to the change - but here's a screenshot of a watch on e in a little sample I put together to see if I could repro this, and I can't - for me, e.OldValue is showing the correct value. I know back in the IP 2003 OM we had to check the operation, but that was improved in the 2007 OM.
    Hilary Stoupa

  • 01-28-2013 02:19 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Parent node Changed Event..

    Good Morning Hilary! Thanks for your reply.i just want to say that i am honoured to get a reply from an Infopath Genius. Since i started working with infopath, which is only month. i have taken few of your examples and implemented on my project. Well back to my question. If you can see the below Debug which i created to shows me that Changin assignee from " to 'administrator', which is meant to be 'ravikumar' to 'administrator' not sure why this happening. The system is meant to check the oldvalue and repalce it with a new value. Even though the system lets me assign to a new assignee but also it lets me reassign to the same assignee,which it shouldnt. Not sure if this all make any sense to you. Thanks for your time. KCAD Case and Action Tracking System http://kcad.myplanb.it/cats 28/01/2013 09:56:53 (ravi.kumar): Changing assignee from '' to 'administrator' 28/01/2013 09:56:53 (ravi.kumar): Assignee Changed 28/01/2013 09:57:10 (ravi.kumar): Assign Action Button Clicked 28/01/2013 09:57:10 (ravi.kumar): Setting Current Action To: GEN-000485-01 28/01/2013 09:57:14 (ravi.kumar): Confirm Assign Action Button Clicked 28/01/2013 09:57:14 (ravi.kumar): Action list found 28/01/2013 09:57:14 (ravi.kumar): Looking for action: GEN-000485-01 28/01/2013 09:57:14 (ravi.kumar): Found action: GEN-000485-01 28/01/2013 09:57:14 (ravi.kumar): Assigning action... 28/01/2013 09:57:14 (ravi.kumar): Action ID: GEN-000485-01 28/01/2013 09:57:14 (ravi.kumar): Action Title: testing 28/01/2013 09:57:14 (ravi.kumar): Action Priority: 2 28/01/2013 09:57:14 (ravi.kumar): Action Assignee: PLANB-02\administrator 28/01/2013 09:57:14 (ravi.kumar): Action Assignee Formatted: administrator 28/01/2013 09:57:14 (ravi.kumar): Action Deadline: 2013-01-28 28/01/2013 09:57:14 (ravi.kumar): Action Status: Open 28/01/2013 09:57:14 (ravi.kumar): Query: GEN-000485-01 28/01/2013 09:57:14 (ravi.kumar): Assignee Value: 1;#PLANB-02\administrator 28/01/2013 09:57:15 (ravi.kumar): Assignee Changed Reset 28/01/2013 09:57:15 (ravi.kumar): Mail From: [email protected] 28/01/2013 09:57:15 (ravi.kumar): Mail To: [email protected] 28/01/2013 09:57:15 (ravi.kumar): Subject: KCAD CATS - Case 'GEN-000485' Action (GEN-000485-01) Assigned 28/01/2013 09:57:15 (ravi.kumar): Body: An action for Case 'GEN-000485' has been assigned to you, this case is now open: CASE DETAILS ------------------------------ Case ID: GEN-000485 Case Type: General (GEN) Originator: ravi.kumar Person In Charge: ravi.kumar Title: Monday Morning Testing Description: Testing Date: 2013-01-28 Location: KCA Deutag, Poland Status: Actions In Progress Link: http://kcad.myplanb.it/CATS/_layouts/FormServer.aspx?XmlLocation=/CATS/General%20Cases/GEN-000485.xml&DefaultItemOpen=1&Source=/CATS Regards, KCAD Case and Action Tracking System http://kcad.myplanb.it/cats 28/01/2013 09:57:15 (ravi.kumar): Case Saved: 28/01/2013 09:57:15 28/01/2013 09:57:50 (ravi.kumar): Changing assignee from '' to 'ravi.kumar' 28/01/2013 09:57:50 (ravi.kumar): Assignee Changed 28/01/2013 09:57:54 (ravi.kumar): Assign Action Button Clicked 28/01/2013 09:57:54 (ravi.kumar): Setting Current Action To: GEN-000485-01 28/01/2013 09:57:58 (ravi.kumar): Confirm Assign Action Button Clicked 28/01/2013 09:57:58 (ravi.kumar): Action list found 28/01/2013 09:57:58 (ravi.kumar): Looking for action: GEN-000485-01 28/01/2013 09:57:58 (ravi.kumar): Found action: GEN-000485-01 28/01/2013 09:57:58 (ravi.kumar): Assigning action... 28/01/2013 09:57:58 (ravi.kumar): Action ID: GEN-000485-01 28/01/2013 09:57:58 (ravi.kumar): Action Title: testing 28/01/2013 09:57:58 (ravi.kumar): Action Priority: 2 28/01/2013 09:57:58 (ravi.kumar): Action Assignee: PLANB-02\ravi.kumar 28/01/2013 09:57:58 (ravi.kumar): Action Assignee Formatted: ravi.kumar 28/01/2013 09:57:58 (ravi.kumar): Action Deadline: 2013-01-28 28/01/2013 09:57:58 (ravi.kumar): Action Status: Open 28/01/2013 09:57:58 (ravi.kumar): Query: GEN-000485-01 28/01/2013 09:57:58 (ravi.kumar): Assignee Value: 34;#PLANB-02\ravi.kumar 28/01/2013 09:57:58 (ravi.kumar): Assignee Changed Reset 28/01/2013 09:57:58 (ravi.kumar): Mail From: [email protected] 28/01/2013 09:57:58 (ravi.kumar): Mail To: [email protected] 28/01/2013 09:57:58 (ravi.kumar): Subject: KCAD CATS - Case 'GEN-000485' Action (GEN-000485-01) Assigned 28/01/2013 09:57:58 (ravi.kumar): Body: An action for Case 'GEN-000485' has been assigned to you, this case is now open:
  • 01-28-2013 04:39 PM In reply to

    Re: Parent node Changed Event..

    I'm sorry - I'm having a terrible time trying to read your post!

    What are you trying to show?

    Hilary Stoupa

  • 01-29-2013 12:49 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Parent node Changed Event..

    Hi Hilary, apologise for my previous post. I dint realise the text were all wrapped up. I was trying to show my debug log, well I have cut short my debug log and this is how it looks like. You can clearly see that changing assignee from '' to 'administrator', where My Old Value is meant to be Ravikumar, but unfortunately i don’t see that for some reason. Is this make any sense to you??? KCAD Case and Action Tracking Systemhttp://kcad.myplanb.it/cats28/01/2013 09:56:53 (ravi.kumar): Changing assignee from '' to 'administrator'28/01/2013 09:56:53 (ravi.kumar): Assignee Changed28/01/2013 09:57:10 (ravi.kumar) Changing assignee from '' to 'ravi.kumar'28/01/2013 09:57:50 (ravi.kumar): Assignee Changed28/01/2013 09:57:54 (ravi.kumar).
  • 01-29-2013 12:52 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Parent node Changed Event..

    I still dont know why my text looks untidy, i edited in word document to make it clearer. But as soon as i post it, it seems to look all messy. Im terribly sorry Hilary. Thanks
  • 01-29-2013 07:28 AM In reply to

    Re: Parent node Changed Event..

    It may be your browser or it may just be the pasting from Word - who knows. Can you just attach a screenshot under the Options tab, like I did?
    Hilary Stoupa

  • 01-29-2013 09:14 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33
    Hi Hilary! Hope this is around its much more clearer. I have taken a screenshot which i have uploaded. As you can see from the picture that the Initial assignee was Ravikumar but it was changed to the administrator but the debug is showing '' to 'administrator'. Is this make any sense to you???. Thanks again
  • 01-29-2013 09:24 AM In reply to

    Re: Parent node Changed Event..

    Have you actually run the code in debug? With a break point on the first line (the if statement)?
    Hilary Stoupa

  • 01-29-2013 09:50 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Parent node Changed Event..

    Debug is something that i created within the form to capture the process. So i can see how the system is running.
  • 01-29-2013 11:31 AM In reply to

    Re: Parent node Changed Event..

    Yes, but I mean run the form in preview on your machine and debug the code from Visual Studio. http://msdn.microsoft.com/en-us/library/aa947485(v=office.11).aspx
    Hilary Stoupa

  • 01-30-2013 12:48 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33
    Hi Hilary! followed your advice, but when i opened the code with the VSTA and set breakpoints. The debug option is inactive. Please see the attachment. Thanks
  • 01-30-2013 09:34 AM In reply to

    Re: Parent node Changed Event..

    Are you using IP 2010? If so, I'd expect the code to open in VSTA. What version of IP are you using? What is the development environment you used to write the code originally?
    Hilary Stoupa

  • 01-31-2013 12:16 AM In reply to

    • Ravik
    • Top 500 Contributor
      Male
    • Joined on 01-25-2013
    • Aberdeen(Scotland)
    • Posts 33

    Re: Parent node Changed Event..

    Hi Hillary! Yes. I am using IP 2010, our coding is done in Visual studio 2008. Thanks
Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.