• NPanter
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi all, 

I am writing a custom button to 'quick close' a case and then open the oldest open case owned by a queue.  Everything is working wonderfully, however when the RetURL runs, it tells me the URL no longer exists.  This button would be run via the service console, so I have used the URL for that.  Anyone have an idea of where the issue is? Code is below....

{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")} 
 
var result = sforce.connection.query("Select Id,CreatedDate From Case where Status !=
'Closed' and OwnerId = 'xxxxxxxxxxxxxxxxx' ORDER BY CreatedDate LIMIT 1");
var records = result.getArray("records");
var oldestCaseId = records[0].Id
 
//window.parent.location.href = "/{!Case.Id}/s?save=1&notifyContact=0&cas7=Closed&nooverride=1&retURL=/ui/support/servicedesk/
ServiceDeskPage#%2F"+oldestCaseId+"%3Fisdtp%3Dvw%26isWsVw%3Dtrue";
 
window.parent.location.href = "/{!Case.Id}/s?save=1&notifyContact=0&cas7=Closed&nooverride=1&retURL=/ui/support/servicedesk/
ServiceDeskPage#";

The code works when I run the above, however when I run the currently commented out line (and comment out the second line), it gives me the error.
 
Any ideas?

Hello all,

 

While I have tonnes of experience with salesforce, my apex previously has been asking my developer.  Thought I would try a simple trigger, or what I thought would be a simple trigger.  Basically, this is what I want it to do:

 

On Cases there is a field called Case_Survey_Sent_Date__c 

On Contacts there is a field called Case_Survey_Sent_Date__c 

 

After the case is saved, I would like to check if the case.Case_Survey_Sent_Date__c is more recent then the contact.Case_Survey_Sent_Date__c and if so, update it.  This is what i have come up with, and lo and behold I am sucking it huge.  Here is what I have so far:

 

trigger updateAccountSurveyDate on Case (after update) {

     Case c;
     for (Contact p = [SELECT id, Case_Survey_Sent_Date__c FROM Contact])
     {
          if (p.Case_Survey_Sent_Date__c < c.Case_Survey_Sent_Date__c){
              p.Case_Survey_Sent_Date__c = c.Case_Survey_Sent_Date__c;
          } else {
               //
          }      
     }
}  

 Now, take a few minutes to compose yourself after the fits of laughter of what I have done...would any of you gurus be able to point me in the error of my ways, or even give me a little to go on?

 

Thanks all,

 

Nik :smileyhappy:

Hello all,

 

While I have tonnes of experience with salesforce, my apex previously has been asking my developer.  Thought I would try a simple trigger, or what I thought would be a simple trigger.  Basically, this is what I want it to do:

 

On Cases there is a field called Case_Survey_Sent_Date__c 

On Contacts there is a field called Case_Survey_Sent_Date__c 

 

After the case is saved, I would like to check if the case.Case_Survey_Sent_Date__c is more recent then the contact.Case_Survey_Sent_Date__c and if so, update it.  This is what i have come up with, and lo and behold I am sucking it huge.  Here is what I have so far:

 

trigger updateAccountSurveyDate on Case (after update) {

     Case c;
     for (Contact p = [SELECT id, Case_Survey_Sent_Date__c FROM Contact])
     {
          if (p.Case_Survey_Sent_Date__c < c.Case_Survey_Sent_Date__c){
              p.Case_Survey_Sent_Date__c = c.Case_Survey_Sent_Date__c;
          } else {
               //
          }      
     }
}  

 Now, take a few minutes to compose yourself after the fits of laughter of what I have done...would any of you gurus be able to point me in the error of my ways, or even give me a little to go on?

 

Thanks all,

 

Nik :smileyhappy: