Infopath form publishing issue - deployment

I designed the infopath form. I am writing required programming code on button clicked event. But while publishing the infopath form i am getting error; Please observe: It should allow me to select "Form Library" option so that i can do. From Microsoft it is suggested from here that i need to remove code. but everything is required in my form. I need to deploy form with code. without code it is without any value.
I have associate tryst certificate as well as my form is with full trust.
My infopath services are configured properly.
I am running sharepoint2010 in 2-tier farm.
I am using Infopath 2010 with Sharepoint 2010.
What else i need to be added...?
If i removes code then it shows me and deployed properly.
Please , give me right direction.
**Edited:**
I deployed this form as form template and activated it by central admin site. and assigned to form library as content type. but while running this form (from Document-> New Document->MyContentTypeTemplate),
i got exception:
Business logic failed due to an exception.
(User: domainname\user, Form Name: MHPMEmployeeInformationTemplateChanged9, IP: , Request: http://spwfe1:7000/_layouts/FormServer.aspx?
XsnLocation=http://spwfe1:7000/FormServerTemplates/MHPMEmployeeInformationTemplateChanged9.xsn&SaveLocation=http:
//spwfe1:7000/OfficialResumeFormLibrary&Source=http://spwfe1:7000/OfficialResumeFormLibrary/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:
office:infopath:MHPMEmployeeInformationTemplateChanged9:-myXSD-2011-09-06T18-40-25, Type: UnauthorizedAccessException, Exception Message: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.) a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7
Verbose Calling GlobalStorage.SetItem with index LastExceptionLogged value type UnauthorizedAccessException. a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7
Medium Exception thrown from business logic event listener: System.UnauthorizedAccessException:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
at EmployeeInformation_Template.DocGenerator.CreateWordDocument(Resume objResume, Object oTemplate)
at EmployeeInformation_Template.FormCode.GetInfopathData() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at
Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at Employe... a2e8bb5f-26d2-485a-bf9c-0a333eaa71e7
Why should This? : I wondered When Microsoft is avoiding to use Interop COM Objects to use for word file automation which i used in my infopath form. Look Here
What i have to do now? do i need to go with alternatives ? or move by trying to resolve the issues ??? Please , i need right direction.

This is by design. As soon as you have code in your form, your only option is to deploy as "Administrator approved Form".
To get the form to show in your library, do the following:
Upload it in the Central Administration (General Applications
Settings -> Manage Form Templates)
activate the according Feature In the "Advanced Settings" section of
your library
allow "ContentType Management"
Add the Form as ContentType

Related

Dynamics CRM Plugin or Extension

I've been following some tutorials to develop a plugin for Dynamics CRM but based on my requirements it seems like it's not what I'm looking for.
public void Execute(IServiceProvider serviceProvider)
{
//Extract the tracing service for use in debugging sandboxed plug-ins.
ITracingService tracingService =
(ITracingService)serviceProvider.GetService(typeof(ITracingService));
It seems above code provides some hooks to post events and interaction within dynamics, what area should I look under if I wanted to embed a custom HTML with content populated via XHR within the regions of Dynamics UI, let's a subsection within the lead? Also getting some contextual information Dynamics UI fields.
You are right. Plugin is for extending execution pipeline in server side transaction.
What you want is Web resource of HTML type, which you can embed in the Lead form.
SO thread to read.
GetGlobalContext function inside HTML web resource will give you the access to context & controls of Lead record (name & email) after referencing ClientGlobalContext.js.aspx. No need to pass name & email manually, though you can send them using querystring to HTML on load with setSrc.

O365 Infopath form REST data source

I cannot get over with an issue related to O365 and an InfoPath form which is having a Data Source calling a REST api.
The case is:
In the site where the InfoPath form is I have a list which I'd like to query for a different data based on the rules from the form;
I have created a REST data source calling the list REST interface (/_api/web/lists/getbytitle ...)
I have followed the steps from the post here and related: http://sympmarc.com/2013/12/23/infopath-2013-forms-on-office365-with-external-rest-datasources/
But still with no success... While trying to query the REST URL InfoPath form keeps telling me that "XML data that is required for this form to function correctly cannot be found." And when I try to edit data connection from the InfoPath application, I'm getting an error that the application cannot open my REST URL and that the file cannot be accessed.
Have anyone got any idea how to solve the issue? For me it really seems like some sort of permissions issue, but I don't know how to solve it.
Regards,
Tomasz

error: Failed to run the post merge process

I'm trying to generate documents using conga composer 8 from apex code but its failing with error Failed to run the post-merge process. I have looked into url and its same as the one I used initially in another salesforce org. I couldn't find any help online or on conga-composer form.
Here is my conga endpoint URL:
https://composer.congamerge.com/Composer8/Index.Html? sessionId=00D41000000dorw!ARQAQKbinH5TXMR_70s3XCShQh5GuSVdrFcq0Fg9OidZLo9MLxzWSby8QY1B4xM8e72DPawVziclnXBjTzpG41RiCAPKQqOt
&serverUrl=https://na35.salesforce.com/services/Soap/u/29.0/00D41000000dorwEAA
&id=a1J410000012BwS
&TemplateId=a0C41000000kg5GEAQ
&APIMODE=13
&ESAgreementName=Contract+for+Test
&queryid=a0441000001PwI7AAK,a0441000001PwICAA0
&ESSignatureType=2
&ESSignatureOrder=2
&ESVisible=1
&ESCustomField=cldocgen__App__c
&ESCustomFieldValue=a1J410000012BwSEAU
&ESRecipient1=00541000000Ke9pAAC
&ESRecipient2=003410000078zVbAAI
&ESRecipient3=003410000078zVhAAI, Method=GET]
Any insight what might be causing this issue.
I had the same problem and was able to solve it using permissions. In this case make sure the user id whose sessionID is passing to Conga has the correct CRUD access to the primary object in your conga call (id=a1J410000012BwS). My guess is that this is something to do with Conga not being able to write the attachment back to salesforce.
Apart from what Greg has mentioned, there are 2 more observations for this error:
Under Email Administration -> Deliverability -> Access to Send Email (All Email Services) should be set to All email.
In case you are using the EmailTemplateId parameter then the classic email template must be available for use.
Also mostly this error is also because of some discrepancy in the URL.

How do I correctly Implement an event on successful form Submission using Google Tag Manager and Sitecore's Web Forms for Marketers?

I am attempting to track successful form Submissions using an event in Google Analytics via Google Tag Manager. My current setup successfully tracks when users submit the form. However, the event still fires even when the form submission is invalid and does not submit (ie a user hasn't filled out all of the required fields, clicks the submit button, the form attempts to validate, but comes back to the user with errors instead of submitting). I have the Check Validation feature on my listener checked which theoretically should keep the tag from firing if the form submission is prevented, so it's not the obvious error.
The form in question is created with Sitecore's Web Forms for Marketers. Colleagues of mine have had similar unsolved issues with their WFFM forms.
This particular form is used to gate content so that only users who fill out the form will have access to the content resource. So for example if I go to www.mydomain.com/resource I will be redirected to www.mydomain.com/form where if I fill out all of my information correctly and submit it I will then be redirected to the resource that I was originally attempting to view at www.mydomain.com/resource.
Here's my setup:
Tag 1
Name: Form Submission Listener
Type: Form Submit Listener
Wait For Tags: Checked
Max Wait Time: 2000 milliseconds
Check Validation: Checked
No advanced Settings
Firing Rule: On form pages by URL
Tag 2
Name: Event Form Submission
Type: Universal Analytics
Tracking ID: UA-.....
Enable Display Advertising Features: Checked
Track Type: Event
Category: Form
Action: Submission
Label: {{Form resource URL}}
Non-Interaction Hit: False
No More Settings
No Advanced Settings
Firing Rules: {{event}} equals gtm.formSubmit
Theoretically the Check Validation check box should prevent the tag from firing if the form does not successfully submit, but in the case of this form it does not. The tag fires regardless of whether the form submits or not.
Apologies that I cannot link to the form as it is for a client and behind security.
We were able to find an answer to our question via the Sitecore forums, but I wanted to pass it along for your benefit.
From Sitecore:
The Web Forms module provides the double level validation, 1-client validation, 2-server validation.
By default, the client validation is disable for the Required Field validator. So, when you press Submit, the form posts to the server, and returns with the validation error. It's a possible reason why Google Analytics considers that as a form submit.
Find the following item in the Master database:
/sitecore/system/Modules/Web Forms for Marketers/Settings/System/System Validation/NotEmpty
Find the "Enable Client Script" checkbox and enable it.
Save and publish the item.
Check whether the issue was fixed.
This fixed the issue for all of our text based fields. It did not fix the issue for the one checkbox on the form. I've followed up with sitecore on this, but I figured that I'd update here in the meantime.
With only the checkbox remaining I was also able to use a a macro and add to my original firing rule in google tag manager so that the event would not fire if the checkbox was not checked.
I created a Custom Javascript Macro called Radio Button Checked (not sure it's the best, but it worked), and added a new condition to my original Form Submission Rule: {{Radio Button Checked}} equals true
The macro:
function() {
var radioName = "radioButtonName";
try {
var buttons = document.getElementsByName(radioName);
for (var i = 0;i < buttons.length;i++){
if(buttons[i].checked) {
return true;
}
}
} catch(e) {}
return false;
}
EDIT: Sitecore got back to me about the checkbox issue.
From Sitecore:
Currently the CheckBox field type doesn't have the client-side validation. I registered it as a bug for the WFFM module. I'll let you know as soon as it's fixed.
They let me know also that this isn't something that will be fixed near-term so I need to continue using my GTM workaround for the check box field.
The Google Chrome plugin "Tag Assistant" is super helpful in debugging these sorts of issues. It will show you what (if any) structural or implementation issues exist on a given page that might be preventing your intended tracking behavior (https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk?hl=en)
My gut feel is that this issue is not specifically related to WFFM, but may be due to the implementation of the Tag Manager code on the page. I seem to recall having an issue like this when the Tag Manager include code gets dumped inside the auto-generated .NET tag when using WebForms in general. Google's docs (https://developers.google.com/tag-manager/quickstart) say to put it immediately after the opening tag, and I recall that being my issue with tracking form submits.
This is all from memory, so I could be wrong, but it's something else to check.
Good luck!

Validate a file when creating content in Alfresco

I want to upload some XML files to Alfresco, so the create con tent form has an input file form element.
I need to check if the XML is well-formed, and I already have the backend validation functions triggered on ResourceBehavior.onContentUpdate. If the XML is malformed, I want to notify the user with a dialog window.
So far, I can prevent the user to submit malformed XML by throwing an exception when the XML is malformed, but I can't figure out how to have share to display an error message.
I have been looking at all the validation JS in share, but remember, file input forms need to be submitted first so that you can have a look at its content, thus the validation has to be server-sided.
Any pointers on where should I begin?
The problem you are going to have is that your backend behaviour is not aware of the specific client session that made the changes and what client session it is that needs to be notified.
If you want to display a useful message then you are going to have to write some additional Share customisation. Some options which you can explore are having an action or webscript that returns whether the XML is valid or not and customising the Share upload form to execute this action/webscript after the file has been uploaded and then return the relevant message to the user.
You'll find a pretty detailed post on modifying the upload form here:
http://www.ixxus.com/blog/2011/09/customising-upload-files-dialog-alfresco-share
If you're feeling lazy then I'd consider just aborting the file creation if the XML is invalid during an onCreate behaviour and then the user will see an 'Internal Error'.