• RurouniQ
  • NEWBIE
  • 0 Points
  • Member since 2012

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

This is probably an exceedingly simple oversight on my part, as I am new to JS and coding in general. So I apologize in advance! I have cobbled together this bit of JS from various sources in order to make a custom list button that replicates the "Send an Email" button in Salesforce, but does so with a few important differences:

  • Prepopulates the To and CC fields with text from other custom fields.
  • Auto-selects a specific email template.
  • Utilizes the merge fields of the email template, pulling data from a record in a custom object. This record would be selected via the checkboxes generated by the custom list button, like so:

The record

 

The user will check one item, then click the Email Comment button, which will pull in the record ID of the checked record and apply the data to the merge fields of the email template.

 

Now here's the problem. Whenever I do this now, I receive an error:

 

A problem with the OnClick JavaScript for this button or link was encountered:

Unexpected string

 

So now I'm stuck! Please help! Here is the code that is entered under the custom list button.

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit 
var checked= {!GETRECORDIDS($ObjectType.Change_Comment__c)}; //grabs the records that the user is requesting to update 
var record = (checked.toString()); 

if (record[0] == null) { //if the button was clicked but there was no record selected 
alert("Please select one record."); //alert the user that they didn't make a selection 
} else if (record.length > 1) { 
alert("Please select ONLY one record."); 
} else { 
location.replace('/email/author/emailauthor.jsp?retURL=/{!SLX__Change_Control__c.Id}&p24={!SLX__Change_Control__c.Requestor_s_Email__c}&p4={!SLX__Change_Control__c.Reports_To_Email__c}&p3_lkid=' + record '&template_id=00X70000001SBNg&'); 
}

 

In the last screen of my flow, I display the various input fields submitted by the user as a confirmation of what s/he enterred. This screen is preceeded by a Record Create task which posted the data to my custom object. All is well except for the fact that my last screen displays the default buttons of "Previous" and "Finish". How do I remove or hide the Previous button so a user does not make an inadvertent double entry by clicking the Previous button and invoking the Record Create a second time?

Hi community,

              This is my case

I had created a pick list of rooms numbers(which has the details of room type AC/Non-AC , Price , capacity and availability).When I Select a pick list of room number, It has to display the room specifications in a seperate tab.How can Fix this using Salesforce Visual force pages.
I am In a bad need of solution.please help.



Thanks In advance
Tarun.M

This is probably an exceedingly simple oversight on my part, as I am new to JS and coding in general. So I apologize in advance! I have cobbled together this bit of JS from various sources in order to make a custom list button that replicates the "Send an Email" button in Salesforce, but does so with a few important differences:

  • Prepopulates the To and CC fields with text from other custom fields.
  • Auto-selects a specific email template.
  • Utilizes the merge fields of the email template, pulling data from a record in a custom object. This record would be selected via the checkboxes generated by the custom list button, like so:

The record

 

The user will check one item, then click the Email Comment button, which will pull in the record ID of the checked record and apply the data to the merge fields of the email template.

 

Now here's the problem. Whenever I do this now, I receive an error:

 

A problem with the OnClick JavaScript for this button or link was encountered:

Unexpected string

 

So now I'm stuck! Please help! Here is the code that is entered under the custom list button.

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit 
var checked= {!GETRECORDIDS($ObjectType.Change_Comment__c)}; //grabs the records that the user is requesting to update 
var record = (checked.toString()); 

if (record[0] == null) { //if the button was clicked but there was no record selected 
alert("Please select one record."); //alert the user that they didn't make a selection 
} else if (record.length > 1) { 
alert("Please select ONLY one record."); 
} else { 
location.replace('/email/author/emailauthor.jsp?retURL=/{!SLX__Change_Control__c.Id}&p24={!SLX__Change_Control__c.Requestor_s_Email__c}&p4={!SLX__Change_Control__c.Reports_To_Email__c}&p3_lkid=' + record '&template_id=00X70000001SBNg&'); 
}