Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Copper Contributor
Posts: 69
Registered: ‎05-07-2012

SLX 7.5.4 Problems generating Outlook E-Mail

We've got a button on a modified attachment grid. OnClick, Outlook should open a new e-mail with pre-defined recipients, subject and attachment (therefore "mailto" is no option).

The codebehind is some javascript code that instantiates the Outlook application com object through an activex object:

 

function getOutlookApplication() {
	if (Sage.gears) {
		// Sage - this is preferred, if available, because it will bypass the security dialog
		try {
			var cf = Sage.gears.factory.create("com.factory");
			return cf.newActiveXObject("Outlook.Application");
		} catch (e) {
			alert(e.get_StackTrace());
		}
	}
	// IE
	if (typeof ActiveXObject != "undefined") {
		try {
			return new ActiveXObject("Outlook.Application");
		} catch (e) {
			alert(e.get_StackTrace());
		}
	}
	return null;
};

With that object we can create a new mail item, fill every information we want and generate the e-mail.

 

Now we have a big problem. Because of some - maybe - security settings the new e-mail won't be generated on our customers preperation or live system. We see the Outlook icon in the information area of the client windows for a short time but nothing else happens.

 

I have debugged through the process and I know there seems to be a problem of returning the new ActiveXObject, because the alert "get_StackTrace" is thrown.

 

Both customer systems are running on Windows Authentication. But we also have a test system that's running on Windows Authentication, too, that doesn't have that problem.

 

Is anyone able to give us some help here or tell us some alternatives to create an e-mail object?

 

Employee
Posts: 629
Registered: ‎04-24-2009

Re: SLX 7.5.4 Problems generating Outlook E-Mail

The in ability for users to use the Outlook object model in JavaScript is likely due to insufficient privileges.

 

The IE options should be:

 

  • Add Sage SalesLogix Web Client site to trusted sites.
  • Initialize and script ActiveX controls not marked as safe for scripting (Enable)
  • Script ActiveX controls marked safe for scripting (Enable). This is required for direct scripting with objects such as Outlook.exe, Excel.exe, and WinWord.exe.
  • If running under Windows Vista (or higher) protected mode must be turned off for trusted sites.

 

Thanks

 

Mike

Copper Contributor
Posts: 69
Registered: ‎05-07-2012

Re: SLX 7.5.4 Problems generating Outlook E-Mail

[ Edited ]

Hallo,

 

We know now, that option 2 "Initialize and script ActiveX controls not marked as safe for scripting (Enable)" has to be set "active" to get our stuff work.

 

The problem is, that our customer will definitely not allow this option, to be set as active as a gpo.

 

Is there any chance to mark that ActiveX as safe?

I saw that the code behind "Copy to E-Mail" Button at the Opportunity Snapshot is completly the same as our code, but the "Copy to E-Mail" link works as designed.

Employee
Posts: 629
Registered: ‎04-24-2009

Re: SLX 7.5.4 Problems generating Outlook E-Mail

The Copy to E-mail link defaults to the mailto: protocol if it cannot create the Outlook object; you could just try calling this script function instead. If you have Desktop Integration installed Sage Gears will instantiate Outlook.exe, and that may work without adding the new permission.

 

Thanks

 

Mike

Copper Contributor
Posts: 69
Registered: ‎05-07-2012

Re: SLX 7.5.4 Problems generating Outlook E-Mail

this is wrong. it's the identically code in 7.5.4. It's defined in Sage.Utility.WriteEmail.
Employee
Posts: 629
Registered: ‎04-24-2009

Re: SLX 7.5.4 Problems generating Outlook E-Mail

[ Edited ]

Perhaps we are not discussing the same thing? I'm looking at the writeEmail() function in the Sage.Utility class, and it will fallback to the mailto protocol if the Outlook.Application object cannot be created.

 

Thanks

 

Mike

Nickel Contributor
Posts: 59
Registered: ‎07-30-2010

Re: SLX 7.5.4 Problems generating Outlook E-Mail

[ Edited ]

This may be a little overkill for your requirement, however for a customer that needed a solution similar to this recently I extended the desktop manager application which registered a Custom URL ("SendQuote://{OpportunityId}"). This then generated a quote document from a template on the user’s computer using SData and finally prepared an email with the quote attached ready to send to the customer

 

One of the major reasons we decided to do it this way was due to the automation of the quote document (which may not be relevant to you), however the other reason was attaching the quote to an email ready to send, we found it was almost impossible to get it to work correctly on different IE versions, plus the FireFox browser some of the users were using with default SalesLogix code.

 

"Mailto" will pick up the processing of the email message if the ActiveX object cannot be created - There is a try..catch statement in the JavaScript that takes care of this in the background for the opportunity snapshot link (as if you notice, this functionality works in FireFox).

Richard Anderson
CRM Consultant
K3 CRM
Copper Contributor
Posts: 69
Registered: ‎05-07-2012

Re: SLX 7.5.4 Problems generating Outlook E-Mail

oh, I didn't see, that is a fallback mode Smiley Sad

 

what we will do:

we created a new entity with the possibility to add contacts and attachments.

 

what should be the email? The recipients are the email addresses of the contacts - so far no problem.

the problem is to get the attachments of this entity to be attached to that email. so the mailto won't work. the only possibilty seams to be some kind of outlook object.

 

@richardanderson. Do you think your customizing could help us here?

Nickel Contributor
Posts: 59
Registered: ‎07-30-2010

Re: SLX 7.5.4 Problems generating Outlook E-Mail

[ Edited ]

Hello,

A similar approach to the solution we developed for a client will work - but it's not an easy solution, the process of extending the installer for the Desktop manager took quite a while to complete successfully. Unfortunately there are not many guides or tutorials out there for carrying out this specific requirement, I had to carry out a lot of testing and investigation before development could start - however it IS possible. If you can get the updated SDK code from Sage for the desktop manager however, it will be a much easier process! However I was unable to! (I had to run a silent install of the Desktop Manager in the background and install my parts over the top!)

AFAIK other than enabling "unsafe" ActiveX objects in IE, there is not much of an option in regards to attaching a file to an email from the web client - because when you think about it, you are allowing the ActiveX object access to browse the local file system - Which is ALWAYS unsafe to IE.

With thanks,

Richard Anderson
CRM Consultant
K3 CRM
Copper Contributor
Posts: 69
Registered: ‎05-07-2012

Re: SLX 7.5.4 Problems generating Outlook E-Mail

Yesterday I found out, that we could have a  problem with wrong / not completely registered Browser Helper Object of the sagegears.dll.

I created another new user to our test server having the problem of not being able to generate an email with an attachment.

I commented out the part of the code that should add the attachment. After this I got an object error and the IE console printed "sage.gears not found" or something like this.

 

I asked my dear friend Google and got this discussion: http://community.sagesaleslogix.com/t5/Developer-Web-Discussions/slx-web-7-5-3-Mailmerge/td-p/14609/...

 

after working through this I was factually able to create the email. next step was to comment in the codepart of adding attachment to the email. and I was happy because this also was working.

 

Today we had run through the steps done yesterday on our customers crm server. But it is not working there.

 

So, what could still be wrong here?

 

Differences:

We're using a Server 2008 R2 with IE 9 as our testing client, they use Windows XP with IE 8. Both in Compatibility Mode.

We have only "Sage SalesLogix Desktop Integration Module Factory", the additionaly have "Sage SalesLogix Desktop Integration Desktop Helper". So they even have more extensions as we have.

Last but not least: They are working with SalesLogix Desktop Manger Version 7.5.4.7048 and we are running on 7.5.4.7129.