• warrenlester
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 16
    Replies

Does anyone have any simple ways of decoding quoted-printable emails within an Apex class.

 

Some emails that we receive are in the form:

 

 This is a multi-part message in MIME format. ------_=_NextPart_001_01C9D327.CEE8F1C3Content-Type: text/plain;      charset="us-ascii"Content-Transfer-Encoding: quoted-printable 

*1X4=20Z68F=20MFD7=20QYBZ

 

=20

 

=20

 

Some, are not depending on the mail client.

 

Thanks in advance,

 

Warren

We are currently using outbound messages for methods of interfacing with external web services. Because these are non real time, I am considering using Apex web services SOAP methods instead.
 
I am therefore trying to convert the WSDL for an outbound message into an Apex class and am having problems.
 
Does anyone have any experience of doing this and some examples of their subsequent use?
 
Thanks in advance.
 
Warren Lester
Does anyone know why outbound messages often get delayed? We are sometimes seeing delays of up to 10 minutes before a particular outbound message is delivered.
Why does it sometimes take so long for an outbound message to be delivered?
 
When it does go (often up to 15-20 minutes later), it does so succesfully. Some of the time they get delivered immediately.
 
Any ideas would be greatly appreciated.
 
Regards,
Warren Lester
I have been using an S Control for some time now, but since winter 07 was deployed it has been giving us this issue on and off.

I use the following javascript to create contracts:

var recContract = new Sforce.Dynabean("Contract");
recContract.set("AccountID","{!Opportunity.AccountId}");
recContract.set("ContractTerm",escape_amp(getValue("Warranty")));
// recContract.set("status","Draft");
var shipDate = fixDate(getValue("ShipDate"));
recContract.set("StartDate",shipDate);
recContract.set("covers__c","Warranty");



var recsContract = new Array(1);

recsContract[0] = recContract;
alert(recsContract);
var saveContract = sforceClient.Create(recsContract);
if(saveContract[0] == null)
throw("Contract Create Failed - " + saveContract.toString());
if(saveContract[0].success != true)
throw("Contract Create Failed - " + saveContract[0].errors[0].message);
 
The array used for the update seems to be well formed, but it always returns an error.

Although this is using beta 3.3 of the ajax toolkit, it was previous working and I can find nothing in the release notes that describe any relevent changes.

Any help would be appreciated.

Warren Lester
I am trying to query records in the ProcessInstanceHistory object for a particular TargetObjectId. From the documentation, this would appear to give all Approval history for a given record.
 
However, nothing is returned from the query "select Id,IsPending,ProcessInstanceId,TargetObjectId,StepStatus,OriginalActorId,ActorId,RemindersSent,Comments,IsDeleted,CreatedDate,CreatedById,SystemModstamp from ProcessInstanceHistory where TargetObjectId = '{ParentRecordID}'
 
 
Is there any way to do this using the API?
 
Warren
I have written an S Control that will calculate the Gross Margin of an opportunity from cost values for each of the products.
 
It can be downloaded from the appexchange here:
 
 
Feedback would be welcomed.
 
Warren
I have built an S Control that I want to place inside a related page. In this case, I calculate GM for an opportunity and then want to display this on my Sales Order record.
 
Writing code to do this was easy, but I can't work out how to format the output to match the style of the other dataCol and labelCol elements.
 
Any ideas? Has anybody else done this?
 
Warren Lester
Our Email2Case agent is continually failing to process messages correctly since the update for winter '07. Has anyone else noticed this? As far as I know, we have not made any changes in the mean time
 
The symptom is that all messages get moved to the Error box and this error appears in the log:
 
2007-01-10 11:44:18,723 479409755 [Thread-1] ERROR com.sforce.mail.GenericClient - java.lang.IllegalStateException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalStateException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.lang.IllegalStateException
at com.sforce.soap.partner.fault.ExceptionCode.fromValue(ExceptionCode.java:125)
at com.sforce.soap.partner.fault.ExceptionCode.fromString(ExceptionCode.java:130)
....
....
....
 
I have logged a case with salesforce support, but since I have had no response yet, I was wondering whether anyone else was experiencing the same or similar issues.
 
???
 
Warren
I have a query:
 
    $query_cases = "SELECT CaseNumber FROM Case WHERE ContactId = '.........' AND (IsClosed = False AND (Status!='Closed' AND Status!='Solved'))";
 
That I can confirm returns no records using sforce explorer. However, when used in PHP always returns a size of either 43 or 49.

    $result_cases = $client->query($query_cases);
    $num_cases = $result_cases->{"size"};
 
Printing debug code to the error log:

    reset($result_cases);
    while (list($key, $val) = each($result_cases)) {
     error_log("$key => $val");
    }
 
gives this:
[08-Nov-2006 15:52:28] done => true
[08-Nov-2006 15:52:28] queryLocator =>
[08-Nov-2006 15:52:28] records => Array
[08-Nov-2006 15:52:28] size => 49
 
Has anyone ever seen this or have a solution??
 
 
Thanks
Warren
I would like to display a report of say "My Open Cases" as a homepage component within an IFRAME or something similar. I have created a report, but the frame also contains the tabset and all the other gumph that is normally displayed when viewing other pages within salesforce.
 
So I thought I would try to write an AJAX S Control to emulate the report, but have so far been unsucessful.
 
Has anyone else managed to achieve this?
 
Warren Lester
Has anyone created (and would be willing to share) a polling job that ages cases to solved after a certain period of inactivity?
 
Thanks in advance.
 
Warren Lester
I am wanting to create a large number of records within resources for a "demo / loan" application within salesforce.
 
Is there a way to import these types of records using something like the SForce Explorer or is this table available via the API?
We are developing a custom SelfService portal that makes extensive use of the SalesForce API  using SOAP and PHP. Can anyone suggest a dedicated server IPP that rents Win 2k3 servers in the San Francisco area or a few short hops from SalesForce?

Does anyone have any simple ways of decoding quoted-printable emails within an Apex class.

 

Some emails that we receive are in the form:

 

 This is a multi-part message in MIME format. ------_=_NextPart_001_01C9D327.CEE8F1C3Content-Type: text/plain;      charset="us-ascii"Content-Transfer-Encoding: quoted-printable 

*1X4=20Z68F=20MFD7=20QYBZ

 

=20

 

=20

 

Some, are not depending on the mail client.

 

Thanks in advance,

 

Warren

My email template (below) works fine when using the "preview" function to populate the Recipient (WhoID) and RelatedTo (WhatID)  - but when a workflow rule triggers the emai lto be sent, it comes back blank as if it's not resolving the who or what correctly. .

Code:
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Account"
    subject="Your website Access"
    replyTo="anaddress@us.com" >

    <messaging:htmlEmailBody >        
    <html>
        <body>
        <p>Hello {!recipient.name}--</p>
        <p>Here is a list of the website access you users currently have for account {!relatedTo.name}:</p>
    <apex:datatable cellpadding="5" var="cts" value="{!relatedTo.Contacts}">
        <apex:column value="{!cts.Name}" headerValue="Name"/>
        <apex:column value="{!cts.Seat_Holder__c}" headerValue="Website Program Access"/>
        <apex:column value="{!cts.Email}" headerValue="Email" />
        <apex:column value="{!cts.Phone}" headerValue="Phone" />
    </apex:datatable>
        </body>
    </html>
    </messaging:htmlEmailBody> 
</messaging:emailTemplate>



I created a simple workflow rule that's called whenever a contact is edited. The workflow rule uses an email alert. The email Alert uses this template. I've checked to make sure the email template is for Contact objects, and that the Recipient is specified as Email Field: Email.

I must be missing something obvious..... any ideas?




Message Edited by icemft1976 on 10-24-2008 09:28 AM

I have been using an S Control for some time now, but since winter 07 was deployed it has been giving us this issue on and off.

I use the following javascript to create contracts:

var recContract = new Sforce.Dynabean("Contract");
recContract.set("AccountID","{!Opportunity.AccountId}");
recContract.set("ContractTerm",escape_amp(getValue("Warranty")));
// recContract.set("status","Draft");
var shipDate = fixDate(getValue("ShipDate"));
recContract.set("StartDate",shipDate);
recContract.set("covers__c","Warranty");



var recsContract = new Array(1);

recsContract[0] = recContract;
alert(recsContract);
var saveContract = sforceClient.Create(recsContract);
if(saveContract[0] == null)
throw("Contract Create Failed - " + saveContract.toString());
if(saveContract[0].success != true)
throw("Contract Create Failed - " + saveContract[0].errors[0].message);
 
The array used for the update seems to be well formed, but it always returns an error.

Although this is using beta 3.3 of the ajax toolkit, it was previous working and I can find nothing in the release notes that describe any relevent changes.

Any help would be appreciated.

Warren Lester
I downloaded the email2case package and configured it. It seems to work fine when I run it from the command-line.
 
Now I want to run it in the background or as a service on a Windows 2003 Server.
 
Not being a Java developer I don't know how to package it so that it can run as a service.
 
I have tried to run the batch file in the background using the AT command but it fails.
 
I have tried looking at SrvAny technology from Microsoft Service Resouce Kit but this only works with EXEs.
 
Could someone please provide me some guidelines on how I can get Email2Case running a service.
 
Thanks,
 
Dean Page.
Applaud-IT
 
Hi All,

I was looking at the screencast for PTODemo (Time Off Manager App). I am very impressed with it. I am wondering if it is available for public use. One thing I am still wondering how to do, I noticed that after the demonstrator clicked on "Submit for Approval", the button (along with a few others) will no longer showing when next time the document opens. How to do that? Anyone?


  • April 04, 2007
  • Like
  • 0
I have built an S Control that I want to place inside a related page. In this case, I calculate GM for an opportunity and then want to display this on my Sales Order record.
 
Writing code to do this was easy, but I can't work out how to format the output to match the style of the other dataCol and labelCol elements.
 
Any ideas? Has anybody else done this?
 
Warren Lester
Our Email2Case agent is continually failing to process messages correctly since the update for winter '07. Has anyone else noticed this? As far as I know, we have not made any changes in the mean time
 
The symptom is that all messages get moved to the Error box and this error appears in the log:
 
2007-01-10 11:44:18,723 479409755 [Thread-1] ERROR com.sforce.mail.GenericClient - java.lang.IllegalStateException
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.IllegalStateException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: java.lang.IllegalStateException
at com.sforce.soap.partner.fault.ExceptionCode.fromValue(ExceptionCode.java:125)
at com.sforce.soap.partner.fault.ExceptionCode.fromString(ExceptionCode.java:130)
....
....
....
 
I have logged a case with salesforce support, but since I have had no response yet, I was wondering whether anyone else was experiencing the same or similar issues.
 
???
 
Warren
I have a query:
 
    $query_cases = "SELECT CaseNumber FROM Case WHERE ContactId = '.........' AND (IsClosed = False AND (Status!='Closed' AND Status!='Solved'))";
 
That I can confirm returns no records using sforce explorer. However, when used in PHP always returns a size of either 43 or 49.

    $result_cases = $client->query($query_cases);
    $num_cases = $result_cases->{"size"};
 
Printing debug code to the error log:

    reset($result_cases);
    while (list($key, $val) = each($result_cases)) {
     error_log("$key => $val");
    }
 
gives this:
[08-Nov-2006 15:52:28] done => true
[08-Nov-2006 15:52:28] queryLocator =>
[08-Nov-2006 15:52:28] records => Array
[08-Nov-2006 15:52:28] size => 49
 
Has anyone ever seen this or have a solution??
 
 
Thanks
Warren
We are looking at implenting the SalesForce support module in the near future. We have everything working pretty much the way we want it (there are some quirks that we have worked around of course), however, one key piece of functionality is still missing. By default when a customer replies to an existing case via e-mail, Email2Case just "attached" the email to the existing case but does not modify ANY fields (an email notification is sent to the case owner). So the problem we are having, is that our support people have nothing to key off of to know purely by logging into SalesForce and looking at the existing cases, which one require immediate attention.

Has anyone out there modified the Email2Case source so that, for example, the status field of a case gets set back to New upon receipt of a new email for an existing case??

Any past experiences or insight would be greatly appreciated.

Cheers,

Joel W

  • September 08, 2006
  • Like
  • 0
We are new to salesforce, using the enterprise edition.
We are looking for a solution to enable a security server to communicate with the SF servers.
Some kind of license management + activation control server application.
Any one has done something like that?
I am wanting to create a large number of records within resources for a "demo / loan" application within salesforce.
 
Is there a way to import these types of records using something like the SForce Explorer or is this table available via the API?
We are developing a custom SelfService portal that makes extensive use of the SalesForce API  using SOAP and PHP. Can anyone suggest a dedicated server IPP that rents Win 2k3 servers in the San Francisco area or a few short hops from SalesForce?
I have wrritten an addin using the Office Tookit that takes a Word document and saves it as an Attachment in the salesforce system.  The problem is, when I set the body field as the Word document, it isn't encoded in Base64 (the API docs say the client app is responsible for encoding and decoding the binary attachments as Base64 when sending or receiving objects including Attachments, MailMerge templates, and S-Controls.
 
I have googled and searched the Microsoft and MSDN pages and haven't found anything yet.  Does anyone know of any converter or have any VBA code that will decode/encode a Word document back and forth between Base64?  Thanks