• Caukajun
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

Hi all,

 

We recently encountered an unusual issue while using the standard Apex HttpRequest class to communicate with a remote REST API server over HTTPS.  Based on our specified parameters, the server returns a CSV report that we later use to update records in Salesforce.  The majority of our callouts to this server behave as expected, but in about 5% of these calls, we receive html code defining the site homepage.  On the Salesforce side, we are not changing any parameters between calling the web service so there is no reason why we should be getting this odd response at random intervals like we are seeing.  In addition, we have several other integrations using the same basic code, only with slight changes to the HttpRequest endpoint and have never encountered this issue before...  

 

We brought up this scenario to the technical support team responsible for this API and according to the logs on their side, the Salesforce HTTP library is occasionally inserting a CONNECT request instead of or in addition to the typical GET request.  Since their API does not support CONNECT requests, the server is returning a default html response.  The following is an example log of the requests sent from our Apex code:

05/09/13 08:52:03 96.43.146.8 www.billiansonline.com /index.php CONNECT 200 6952 3501
05/09/13 08:52:03 96.43.146.8 www.billiansonline.com /api.php ?

 

We've tried replicating the issue on our end using Firebug and other browser tools, but have not been able to witness a CONNECT request coming out of Salesforce from these logs or the Salesforce Debug Log.  We have opened support cases with both Salesforce and this third party company with little success so we are turning to other developers on this forum in hopes of shedding some light on this issue.  Have any of you encountered something like this before?  Any suggestions on how we can better diagnose the problem?

 

Thanks in advance for your help!

-caukajun 

Hi all,

 

We recently ran into the org email limit of 1000 outbound messages per day.  To get around this, we've had to change the way we send emails in our application so that instead of creating a single message with multiple recipients using the setCcAddresses method, we are now having to send multiple messages to each recipient individually using setTargetObjectId. This gets us around the email limit since we are now sending each message to our internal users, however, each message no longer shows who the other recipients of this message are. Do any of you know how we could address multiple User's in a single email message? We have looked into MassEmailMessage class, but this requires a 1 to 1 relationship between User ID's and record ID's sent to setWhatIds. Our use case requires multiple recipients be alerted for each record, however, all of the recipients are internal SF users. Is there a way to do this so that none of them count against the org email limit?

 

Thanks in advance,

caukajun

Hello all,

 

I'm looking to process a .xlsx file from Excel in Apex code but have not been able to find any documentation on how to do this.  Can someone point me towards an answer?  I know I can process the file if it gets converted to .csv but I'm trying to avoid having to request this from the user if I don't have to.  Any help would be greatly appreciated, thanks!

 

caukajun

Hi all,

 

Do any of you know how I could increase the default size of the input text box that pops up whenever a user double clicks a field to edit? I've included a screenshot of the text box to give everyone a better idea. This box only pops open for large text area fields when I've got inline editing enabled. When not in "inline editing" mode, you can customize input field text box sizes with relative ease using <style "width: 80%;"/> or something similar, however, this does not work when your page has inline editing enabled. Any ideas?

 

Example of Inline Editing Popup Input Text Box

 

Thanks,

caukajun

 

 

Hi all,

 

We recently encountered an unusual issue while using the standard Apex HttpRequest class to communicate with a remote REST API server over HTTPS.  Based on our specified parameters, the server returns a CSV report that we later use to update records in Salesforce.  The majority of our callouts to this server behave as expected, but in about 5% of these calls, we receive html code defining the site homepage.  On the Salesforce side, we are not changing any parameters between calling the web service so there is no reason why we should be getting this odd response at random intervals like we are seeing.  In addition, we have several other integrations using the same basic code, only with slight changes to the HttpRequest endpoint and have never encountered this issue before...  

 

We brought up this scenario to the technical support team responsible for this API and according to the logs on their side, the Salesforce HTTP library is occasionally inserting a CONNECT request instead of or in addition to the typical GET request.  Since their API does not support CONNECT requests, the server is returning a default html response.  The following is an example log of the requests sent from our Apex code:

05/09/13 08:52:03 96.43.146.8 www.billiansonline.com /index.php CONNECT 200 6952 3501
05/09/13 08:52:03 96.43.146.8 www.billiansonline.com /api.php ?

 

We've tried replicating the issue on our end using Firebug and other browser tools, but have not been able to witness a CONNECT request coming out of Salesforce from these logs or the Salesforce Debug Log.  We have opened support cases with both Salesforce and this third party company with little success so we are turning to other developers on this forum in hopes of shedding some light on this issue.  Have any of you encountered something like this before?  Any suggestions on how we can better diagnose the problem?

 

Thanks in advance for your help!

-caukajun 

Hi all,

 

Do any of you know how I could increase the default size of the input text box that pops up whenever a user double clicks a field to edit? I've included a screenshot of the text box to give everyone a better idea. This box only pops open for large text area fields when I've got inline editing enabled. When not in "inline editing" mode, you can customize input field text box sizes with relative ease using <style "width: 80%;"/> or something similar, however, this does not work when your page has inline editing enabled. Any ideas?

 

Example of Inline Editing Popup Input Text Box

 

Thanks,

caukajun

 

 

I am trying to write a batch apex job that will cycle through a list of records..

 

For each record, I need to get the VF Document related to it as a PDF and email it as an attachment.

 

The PDF always comes across as blank. I know I must bemissing something small because the exact same code works in a static apex class......

 

Can someone please help me resolve this?

 

Note: the code attached just attaches the file to the object for testing purposes...

 

this is the execute method. Everything else works except the actual PDF is empty

 

 

Map<ID,MYOBJECT__c> mFSA = New Map<ID,MYOBJECT__c>((MYOBJECT__c[])(database.query(query)));
    
    
    PageReference pr;
    blob pdf;
    
    For(FSA__c f : mFSA.values()){
    
        pr = New PageReference('/apex/ReportPDF?id=' + f.id ); 

        pdf = pr.getContentAsPDF();
        
        Attachment a = New Attachment();
        a.body = pdf;
        a.parentID = f.id;
        a.Name = 'FSA.pdf';
        insert a;
        
    
    }


 

Hello,

We have added a field "Assign to" on Case (a lookup on user) to let Salesforce.com users the ability to change the owner of a case from the case list. The Case owner is then updated via a trigger (before update on case) that is copying the "Assign to" field value into the Case.owner field.

The trigger works fine and the case owner is updated correctly.

The issue is that when the case owner is updated via that procedure, an automatic email is sent to the new Case owner to warn him that he s now assigned to the case. We do NOT want this email to be sent.

How can we prevent that email to be sent? Is there a piece of code available for that?


Here is the code I'm using currently:

trigger AssignToCaseOwner on Case (before update) {
	Integer i = 0;
	for(Case theCase : System.Trigger.new)
	{
		// only executed if the case owner is not changed as well 
		// and if the case owner is not already the "Assign to" user
		if(theCase.OwnerId == System.Trigger.old.get(i).OwnerId && 
			theCase.Assign_to__c != null && 
			theCase.Assign_to__c != System.Trigger.old.get(i).Assign_to__c && 
			theCase.OwnerId != theCase.Assign_to__c)
		{
			theCase.OwnerId = theCase.Assign_to__c;
			// set DML options to remove the auto email -> NOT WORKING
			Database.DMLOptions dlo = new Database.DMLOptions();
			dlo.EmailHeader.triggerUserEmail = false;
			theCase.setOptions(dlo);
		}
		
		// Make the "Assign to" field empty as we do not need the value 
		// to be stored in the record
		theCase.Assign_to__c = null;
	
		i++;
	}
}

 

 

Thanks on beforehand,
Martin HUBERT.