Publish a form which contains code - InfoPath Dev
in

InfoPath Dev

Publish a form which contains code

Last post 04-29-2010 02:42 AM by alexia_net. 15 replies.
Page 1 of 2 (16 items) 1 2 Next >
Sort Posts: Previous Next
  • 04-27-2010 03:53 AM

    Publish a form which contains code

    Hi. I have created a form which contains code for doing some saving in a sql database. I have used the Design Checker to see if i have any error. It looks ok. I have enabled the form to be web compatible also. I publish it in a share point server (If I choose, during the publish processEnable this form to be filled using a browser, i can choose only Adminstrator approved option, so i do not check this). I proceed with the process publishing the form in Share Point. When I want to use it from share point i get a message saying: The form has been closed. Any idea why? The form is full trust. Thank you!

  • 04-27-2010 04:42 AM In reply to

    Re: Publish a form which contains code

    you will need to set the trust level to domain or full trust (if domain doesnt work). Also you will need to sign the form template.

    go to tools -> form options -> security and trust. to do these thing and then publish.

    check this  for how to publish browser enabled forms properly

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-27-2010 05:25 AM In reply to

    Re: Publish a form which contains code

     Thank you. I have done this. The strange thing is: before to upload it you have the possibility to check the form. I get no error. When I click upload i have an error: there is an error in the internla startup of the form. What error? I do not know. I have some code there, but i get no errors. So I am lost. :)

     

  • 04-27-2010 05:29 AM In reply to

    Re: Publish a form which contains code

     This is what i have in the startup

            public void InternalStartup()
            {
                ((ButtonEvent)EventManager.ControlEvents["btnSaveBuilding"]).Clicked += new ClickedEventHandler(btnSaveBuilding_Clicked);

                 WindowsIdentity objcurrentIdentity =  WindowsIdentity.GetCurrent();
                 XPathNavigator objRoot = this.MainDataSource.CreateNavigator();
                 XPathNavigator objXnDoc = this.MainDataSource.CreateNavigator();
                 string strUserInfo="";
                 strUserInfo = objcurrentIdentity.Name;

            
                objRoot.SelectSingleNode("/my:AddBuilding/my:txtUserInfo", this.NamespaceManager).SetValue(strUserInfo);
            }

  • 04-27-2010 05:31 AM In reply to

    Re: Publish a form which contains code

    can you check via design checker, what problems does that forsee in the template.

    to do so click view->design task -> Design checker.

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-27-2010 05:34 AM In reply to

    Re: Publish a form which contains code

     Hi. Done that already. I have checked all. No errors.

  • 04-27-2010 05:53 AM In reply to

    Re: Publish a form which contains code

    can you attach the template and the code, i will try it on one of our test environment.

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-27-2010 06:00 AM In reply to

    Re: Publish a form which contains code

     Sure. How do I attach it?

  • 04-27-2010 06:04 AM In reply to

    Re: Publish a form which contains code

    click Reply -> options -> add/update

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-27-2010 06:06 AM In reply to

    Re: Publish a form which contains code

     Here it is. Thank you!

  • 04-27-2010 06:43 AM In reply to

    Re: Publish a form which contains code

    i need the code also. the code is located at \\dc-srv\users\Alexandru\My Documents\InfoPath Projects\tmplAddBuilding5

    attach the zip of tmplAddBuilding%

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-27-2010 06:47 AM In reply to

     Sorry. I thought that it was in the form. I hope this is ok now. Thank you!

  • 04-28-2010 01:51 AM In reply to

    Re: Publish a form which contains code

    the attachment doesnt seem to contain all the files. Please attach the whole folder

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-28-2010 02:05 AM In reply to

     Hi. Here it is. Thank you!

  • 04-28-2010 07:28 AM In reply to

    Re: Publish a form which contains code

    move  below code out of internat startup. At internal start up  to FormEvents_Loading.

    in internal start up we only register events.

     

    //WindowsIdentity objCurrentIdentity = WindowsIdentity.GetCurrent();

    //XPathNavigator objRoot = this.MainDataSource.CreateNavigator();

    //XPathNavigator objXnDoc = this.MainDataSource.CreateNavigator();

    //string strUserInfo="";

    //strUserInfo = objCurrentIdentity.Name;

    //adaugare user in campul de pe form

    //objRoot.SelectSingleNode("/my:AddBuilding/my:txtUserInfo", this.NamespaceManager).SetValue(strUserInfo);

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 2 (16 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.