• JonathanMClarke
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hello everyone,

 

We are trying at our company to setup a simple SMS-to-Case service. The service we are using sends an HTTP request to the salesforce.com servers when it receives a text message to our short code. Everything to the point of setting up the actual new case in Salesforce.com is completel however, the service we are using requires a 200 OK response to be sent back. Some Apex tips and hints for a newbie would be nice... Here is the code I have so far:

 

public class createSMSCase
{
  Case newSMScase = new Case();
  public PageReference submitSMS()
  {
  String message = ApexPages.currentPage().getParameters().get('Message');
  String phonenumber = ApexPages.currentPage().getParameters().get('PhoneNumber');
  newSMScase.Description = message;
  newSMScase.Supplied_Number__c = phonenumber;
  newSMScase.Origin = 'SMS';
  newSMScase.Priority = 'High';
  newSMScase.Status = 'New';
  newSMScase.Subject = 'SMS Text Message';
  insert newSMScase;
  return null;
    }
}

 

Can anyone let me know how to send messages back to HTTP servers using APEX? I'm stumped at this point as I have never done this in any sort of coding before....

 

Thanks in advance for your pointers and help with this issue!

Jon

Currently have the following trigger which works perfectly for one record inside our production organization:

 

trigger createCommissionClosedWon on Opportunity ( before insert, before update) {
    Opportunity[] opps = Trigger.New;
    for (Opportunity o:opps){
    If (o.StageName == 'Closed Won')
       CreateCommissionRecords.createCommissionRecords(opps);
}}

 I'm trying to bulkify this trigger so that it performs well under bulk updates..... The following code creates an error when I try and save:

 

trigger createCommissionClosedWon on Opportunity (before insert, before update) {

    for (Opportunity opps: Trigger.New){
    	If (opps.Stage == 'Closed Won'){
   		CreateCommissionRecords.createCommissionRecords(opps);
}}}

 What am I doing Wrong??? This is the error message that I'm receiveing: Save error: Method does not exist or incorrect signature: CreateCommissionRecords.createCommissionRecords(SOBJECT:Opportunity)  

 

it sounds like a variable / definitional problem.... Thanks so much for helping me.....

 

 

 

<script type="text/javascript">
$(window).load(function() {
$('.flexslider').flexslider();
});
</script>

 Currently trying to convert an old HTML template into a new APEX website. Can someone try and help me convert the above call? I'm having a terrible trouble trying to get this function to work on this site. Thanks in advance for all potential thoughts. Needless to say I'm learning all this stuff for the 1st time!





I've built the warehouse application in the force.com workbook and all is stored in my company's sandbox. The application is finished and I'd like to transfer it to my production organization; however, have received the following error and do not know how to rectify....

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.MassUpdateSimpleController.value: line 111, column 25 Class.MassUpdateSimpleControllerTest.singleUpdateTest: line 33, column 6 External entry point.

Currently have the following trigger which works perfectly for one record inside our production organization:

 

trigger createCommissionClosedWon on Opportunity ( before insert, before update) {
    Opportunity[] opps = Trigger.New;
    for (Opportunity o:opps){
    If (o.StageName == 'Closed Won')
       CreateCommissionRecords.createCommissionRecords(opps);
}}

 I'm trying to bulkify this trigger so that it performs well under bulk updates..... The following code creates an error when I try and save:

 

trigger createCommissionClosedWon on Opportunity (before insert, before update) {

    for (Opportunity opps: Trigger.New){
    	If (opps.Stage == 'Closed Won'){
   		CreateCommissionRecords.createCommissionRecords(opps);
}}}

 What am I doing Wrong??? This is the error message that I'm receiveing: Save error: Method does not exist or incorrect signature: CreateCommissionRecords.createCommissionRecords(SOBJECT:Opportunity)  

 

it sounds like a variable / definitional problem.... Thanks so much for helping me.....

 

 

 

Hi all,

 

How to use JQuery in salesforce.com?

 

Cann you please provide any pdf with Examples

 

Thanks for your help.......



I've built the warehouse application in the force.com workbook and all is stored in my company's sandbox. The application is finished and I'd like to transfer it to my production organization; however, have received the following error and do not know how to rectify....

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.MassUpdateSimpleController.value: line 111, column 25 Class.MassUpdateSimpleControllerTest.singleUpdateTest: line 33, column 6 External entry point.

Hi,

 

Can someone help, I keep getting the error:

System.DmlException: Insert failed. First exception on row 0 with id 00oS0000000AOgYIAW; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

 

But I am pretty sure that there is no Id specified in my insert call.

Here is my code:

 

 

public PageReference save() { List<OpportunityLineItemSchedule> revenueSchedulesToUpdate = new List<OpportunityLineItemSchedule>(); List<OpportunityLineItemSchedule> revenueSchedulesToInsert = new List<OpportunityLineItemSchedule>(); for(revenueSchedulesDate revenueSchedulesDate:revenueSchedulesDates){ for(OpportunityLineItemSchedule revenueSchedule:revenueSchedulesDate.getRevenueSchedules()){ if(revenueSchedule.get('Id') == null) revenueSchedulesToInsert.add(revenueSchedule); else revenueSchedulesToUpdate.add(revenueSchedule); } if(revenueSchedulesToUpdate.size() > 0) update revenueSchedulesToUpdate; if(revenueSchedulesToInsert.size() > 0) insert revenueSchedulesToInsert; } return Page.revenueScheduleView2; }