• izeta
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 1
    Questions
  • 4
    Replies
Map<String,String> params = RestContext.request.params
I use the above code to retrieve the parameters passed in the body of the request call. It seems like that is the only way since the requestBody is empty due to a forgotten reason that can be found in the forums (the line I use is shown below)
RestContext.request.requestBody.toString();

I am retrieving the params values fine the following way:
String event = params.get('event');
I noticed that the values retrieved are automatically decoded, such as %40 into @, %20 into space, etc in all fields such as dates and emails: 
2016-04-25%2017%3A36%3A34%20-0700, example%40hotmail.com

But recently, I realized that special/international characters were being decoded wrong. OCEG%C3%A1 is supposed to be OCEGá but instead it gives out OCEGá. I believe this happens to various special characters and not limited to á.

The solutions to come to my mind is to either remove the automatic decoding, or force Salesforce to decode it correctly. I think UTF-8 would work fine. But I don't know how to do any of this.

Is there a way to solve this?
Thanks!
  • April 29, 2016
  • Like
  • 0
Map<String,String> params = RestContext.request.params
I use the above code to retrieve the parameters passed in the body of the request call. It seems like that is the only way since the requestBody is empty due to a forgotten reason that can be found in the forums (the line I use is shown below)
RestContext.request.requestBody.toString();

I am retrieving the params values fine the following way:
String event = params.get('event');
I noticed that the values retrieved are automatically decoded, such as %40 into @, %20 into space, etc in all fields such as dates and emails: 
2016-04-25%2017%3A36%3A34%20-0700, example%40hotmail.com

But recently, I realized that special/international characters were being decoded wrong. OCEG%C3%A1 is supposed to be OCEGá but instead it gives out OCEGá. I believe this happens to various special characters and not limited to á.

The solutions to come to my mind is to either remove the automatic decoding, or force Salesforce to decode it correctly. I think UTF-8 would work fine. But I don't know how to do any of this.

Is there a way to solve this?
Thanks!
  • April 29, 2016
  • Like
  • 0

Hi:

 

I am using Force.com IDE to develop an application. I am connected to a Developer org.

 

I I delete an Apex class in IDE, and then sychronize the project with the server, the following message pops up:

 

"Change is incoming. Are you sure you want to overide the incoming addition and apply local deletion to the server?"

 

I respond with "yes".

 

Force.com IDE proceeds with processing and refreshes the sychronize view. The class is still there and has NOT been deleted from the server.

 

Is this the normal result from this processing? Can I delete a class from the server via the Force.com IDE? And, further, I cannot find any document that describes this behaviour.

 

Any help is really appreciated!!

 

Ed

 

I have reached my 24 hour limit.  Can I see a log of my 6000 api calls so I can see where I used all my allocated resources?

is there a way to do a multi line string in Apex Code?

 

This is an example from PHP (http://php.net/manual/en/language.types.string.php)

 

$str = <<<'EOD'
Example of string
spanning multiple lines
using nowdoc syntax.
EOD;

  • April 10, 2012
  • Like
  • 1
How do I throw an exception? The developers guide helpfully tells me to use the throw statement and provide it with an exception object but then unhelpfully provides the following example:
 
throw <exceptionObject>;
 
I tried:
 
throw new Exception('error message');
 
but get the error - type cannot be constructed: Exception.
 
I did find something that said I could not construct any of the system exceptions so then what excepetion object can I provide to the throw statement?