Error while hiding a section control - InfoPath Dev
in

InfoPath Dev

Error while hiding a section control

Last post 06-10-2008 06:39 AM by mehtavipulk. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-06-2008 05:41 AM

    Error while hiding a section control

    Hi,

     I have an section control on my page & I need hide id based on some condition. I have implemented below code for hiding section control

     CurrentView.ExecuteAction(ActionType.XOptionalRemove, "EULA");

    But while executing that I get the followign error. The fieldname of the section is "EULA"

    System.NotImplementedException: The method or operation is not implemented.
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.ViewHost.ExecuteAction(ActionType action, String xmlToEdit)
    at ExternalAccountForm.FormCode.FormEvents_Loading(Object sender, LoadingEventArgs e) in D:\Inetpub\WWWROOT\InfoPath\Forms\ExternalUser\FormCode.cs:line 199
    at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.<>c__DisplayClassa.<add_Loading>b__3()
    at Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)
    at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass6.<add_Loading>b__2(Object sender, LoadingEventArgs e)
    at Microsoft.Office.InfoPath.Server.SolutionLifetime.FormEventsHost.<>c__DisplayClass34.<FireLoadingEvent>b__30()
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)


    An entry has been added to the Windows event log of the server.
    Log ID:5337

    What might be the issue?

     Regards,

    Vipul Mehta

    Vipul Mehta
  • 06-06-2008 07:04 AM In reply to

    Re: Error while hiding a section control

    What code are you using to hide it? What happens around line 199? Have you tried hiding it using conditional formatting and rules i.e. not through code? 

  • 06-06-2008 07:24 AM In reply to

    Re: Error while hiding a section control

    I use below code

    XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:OptionalEULAGroup", NamespaceManager);
    CurrentView.SelectNodes(node, node, "CTRL82");
    CurrentView.ExecuteAction(ActionType.XOptionalRemove, "group1_154");

    My requirement is to hide this section on Edit mode of the form & display it on insert mode. So in that case I do not use the rules & conditions

    BTW Can I only use Optional Section control for such a requirement?

    Vipul Mehta
  • 06-09-2008 01:56 AM In reply to

    Re: Error while hiding a section control

    Can you tell us a little about the parameters you use in your code?

    XPathNavigator node = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:OptionalEULAGroup", NamespaceManager);
    CurrentView.SelectNodes(node, node, "CTRL82");
    CurrentView.ExecuteAction(ActionType.XOptionalRemove, "group1_154");

    According to http://msdn.microsoft.com/en-us/library/aa945763.aspx
    The first two parameters of your SelectNodes method should be a start and end node, yours are both the same. Is this correct? Also, what is CTRL82? Is it the same as OptionalEULAGroup?

    On your last line what is the contents of group1_154?
    http://msdn.microsoft.com/en-us/library/aa944286.aspx
    http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.actiontype.aspx

     

    >BTW Can I only use Optional Section control for such a requirement?

    This is the only way I know of.

  • 06-10-2008 06:39 AM In reply to

    Re: Error while hiding a section control

    CTRL82 is the ViewContext name (if you right click the Optional section control -> Advanced tab)

    OptionalEULAGroup is the name of the field / group name

    group1_154 is the value of XmlToEdit For XOptional field (if you right click the Optional section control -> Advanced tab)

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