Error: The custom code in the form cannot be run. - InfoPath Dev
in

InfoPath Dev

Error: The custom code in the form cannot be run.

Last post 04-23-2013 05:39 PM by Kelly Anderson. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 04-21-2013 09:55 PM

    Error: The custom code in the form cannot be run.

    Hi,

     I have a form that has qRules 4.2 injected into it.  The only qRules command I am using is SubmitToSharePointList and FormatDate.  When I open the form in a web browser, I get the error message "The custom code in the form cannot be run.  This functionality may be deactivated on the server.  For more information, contact the server farm administrator."  The sandbox service is on.

     Can someone help please.

    Thanks.

    Kelly

  • 04-22-2013 12:51 AM In reply to

    Re: Error: The custom code in the form cannot be run.

    I believe we have encountered this behavior when the person publishing the form is not a site collection administrator. Could you ensure that the person publishing the form is a site collection admin?
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-22-2013 01:40 AM In reply to

    Re: Error: The custom code in the form cannot be run.

    Yes, I am a site collection administrator.  It was working for a while, then all of a sudden it stopped working...
  • 04-22-2013 06:21 AM In reply to

    Re: Error: The custom code in the form cannot be run.

    I would suggest creating a test form with some very simple code, and publishing that. It may be a SharePoint issue where no code is being allows at the moment (due to a config issue).

    Such a test would at least tell us if it's a server issue or an issue specific to a form with qRules.

    I'm attaching a test form with some simple code for your convenience.

    Let us know what you find. Thanks!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 04-22-2013 05:22 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    The form you attached worked fine.  No issues loading with browser.  Any more ideas?
  • 04-22-2013 05:29 PM In reply to

    Re: Error: The custom code in the form cannot be run.

     Are you using Office 365? Or is this your SharePoint server? If it is a server you can access the logs on, trigger the error by trying to open the form and check the log files - default locations here.

    Hilary Stoupa

  • 04-22-2013 05:53 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    Is there anything specific I should be looking for?
  • 04-22-2013 05:58 PM In reply to

    Re: Error: The custom code in the form cannot be run.

     I usually cause the form to fail (in your case, it sounds like just opening it does that) then check the most recent log file. I start at the bottom and search up, looking for the name of my form. I have just found that sometimes I can find the issue in the logs even when there isn't a correlation ID. I know they are painful to read....

    Hilary Stoupa

  • 04-22-2013 06:02 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    Here's a section from the log file that I think might be telling me what the error is... Although, I can't make any sense of it.

    04/23/2013 10:55:23.20  SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium    -  - Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. - userCodeWrapperType = "Microsoft.Office.InfoPath.Server.Host.FormServerUserCodeWrapper", userAssemblyGroupId = "8958EA5F802A48EBA317A9C7922ECC04-xoU7vhIi09KDniL3KzNS5BgXf6+WUQYAtKdLMrJV1OI=", siteCollectionId = "968421e1-386f-4a24-839c-016e2086977a" - Inner Exception: Microsoft.SharePoint.UserCode.SPUserCodeSolutionProxiedException: An XML error has occurred.    Server stack trace:      at Microsoft.Office.InfoPath.Server.Xml.SafeXmlReader.ThrowIfXmlMaxDepth()     at Microsoft.Office.InfoPath.Server.Xml.SafeXmlReader.Read()     at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)     at System.Xml.XmlLoader.LoadDocSequence(XmlDocum... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...ent parentDoc)     at System.Xml.XmlDocument.Load(XmlReader reader)     at Microsoft.Office.InfoPath.Server.Xml.SafeXmlDocument.Load(XmlReader reader)     at Microsoft.Office.InfoPath.Server.Xml.SafeXmlDocument.LoadXml(String xml)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventRichTextChange.XHTMLFixer(String xhtml)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventRichTextChange.HtmlToCleanXHtml(String html, Boolean makeDomCompatible)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ItemFieldConnectorRichText.WriteValueNode(ListField fieldInformation, XmlWriter resultWriter, Object value)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ItemFieldConnectorRichText.WritePropertyFromItem(Context context, ResultListItem listItem, XmlWriter resultWrit... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...er, ListField fieldInformation, String itemFieldsNamespacePrefix, String itemFieldsNamespace)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.PopulateXmlForMultipleItems(Context context, ResultListItemIterator listItems, Dictionary`2 existingFields, Int64& auxDomSize)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.<>c__DisplayClasse.<Execute>b__3(Boolean impersonatedIdentity)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterUtil.Impersonate(DataAdapterInformation adapterInfo, String userName, String userDomain, String password, CodeToRunUnderImpersonation codeToRun)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterUtil.Impersonate(DataAdapterInformation adapterInfo, String userN... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...ame, String password, CodeToRunUnderImpersonation codeToRun)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.Execute(String siteUrl, Guid listId, SPContentTypeId contentTypeId, Document document, DataAdapterListDataProvider documentAdapter, Boolean useDcl, XPathNavigator queryFields, XPathNavigator resultFields, Boolean isListItemEditing, Boolean discoveryOnly, Int64& auxDomSize)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterListDataProvider.ExecuteInternal(XPathNavigator queryFields, XPathNavigator resultFields, Boolean useListItemMode)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.QueryDataOnLoad(DataAdapter documentDataAdapter, DataObject documentDataObject)     at Microsoft.Office.InfoPath.Server.DocumentLif... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...etime.Document.ExecuteInitOnLoadForDataObjects()     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.LoadFromRemoteContext(Boolean firstOpened, String editingSessionId, Solution solution, Byte[] serializedState, Byte[] serializedVersionState, Dictionary`2 inputParams, OpenParameters openParameters)     at Microsoft.Office.InfoPath.Server.Controls.XmlFormView..ctor(Solution solution, RemoteExecutionContext remoteExecutionContext)     at Microsoft.Office.InfoPath.Server.Host.FormServerUserCodeWrapper.Execute(SPUserCodeExecutionContext executionContext)     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.ExecuteWrapper(SPUserCodeWrapper wrapper, SPUserCodeExecutionContext executionContext)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateP... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...rocessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)     at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.CodeToExecuteWrapper.EndInvoke(IAsyncResult result)     at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, ... f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20* SPUCWorkerProcess.exe (0x1B60)           0x2BBC SharePoint Foundation          Sandboxed Code Service         fe8s Medium   ...Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext, Boolean shouldUsageLog, Int32 currentProcessId) f4aabf2a-f892-4607-9104-96b130daa1c6
    04/23/2013 10:55:23.20  SPUCHostService.exe (0x0788)             0x0F34 SharePoint Foundation          Sandboxed Code Service         0000 Medium    -  - An XML error has occurred. - Request executing userSolution Id "8958ea5f-802a-48eb-a317-a9c7922ecc04" for site collection id " 968421e1-386f-4a24-839c-016e2086977a" has encountered an unhandled exception while executing user code. f4aabf2a-f892-4607-9104-96b130daa1c6

  • 04-22-2013 06:11 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    Do you have any data connections executing on load in your form? Can you either attach your form to a reply (under options) or email to Support AT Qdabra DOT com and reference this thread? I'm not sure what is going wrong either, but it seems that maybe a data adapter to a list is part of the problem? We might be able to narrow the issue down at least. :)

    Hilary Stoupa

  • 04-22-2013 06:20 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    I've just emailed it to [email protected]

    Yes, there are data connections on load.

  • 04-22-2013 06:34 PM In reply to

    Re: Error: The custom code in the form cannot be run.

     The error mentions an issue with XML and has a little something about rich text. So, I'm wondering about data connections like TAGS Book, which has a rich text field - tagNotes. Can you take a copy of your form, and temporarily disable data connections on load that have XHTML fields like tagNotes? I'm headed offline for the day, but let me know if you have different results - you may want to publish this to a new library.

    Are you sandboxing this form (publishing directly to library) or admin approving?

    Hilary Stoupa

  • 04-22-2013 09:02 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    One of my data connections is loading the AuditTrail which is causing the problem.  Once I've unticked it, it works fine.

     Thanks very much for your help.

  • 04-23-2013 07:04 AM In reply to

    Re: Error: The custom code in the form cannot be run.

    So, the error indicates that the issue may be with rich text - is this something you can work around? Or can you take a look at the entries in that list and get an idea for which one may be causing the issue (i.e. - you weren't having a problem last week, you are this week - what list items have been added or modified between now and then?)

    Hilary Stoupa

  • 04-23-2013 05:39 PM In reply to

    Re: Error: The custom code in the form cannot be run.

    I think I accidentally included the AuditTrail column in the data connection of the list.  Although, no where in the form is using that specific column. It's strange that it should stop the form from loading.  That column contains a lot of text being audit trail.  That's probably what is causing the problem...
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.