-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
9Questions
-
9Replies
How can I modify this OnClick JavaScript so that it will also mark a custom checkbox field True while processing?
I have this OnClick java button that I need to modify so that it also marks a custom field True while processing. Here is the current code:
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
// Call the web service method to display the Email Author JSP page for
// the Work Order email template. Result is an object with success="true" or "false"
// and msg = "error message or other string."
try {
var result = sforce.apex.execute(
'Work_Order_Buttons', // class name
'sendWorkOrder', // methodName
{
oppIdraw: "{!Work_Order__c.Id}"
}
);
if (result[0].success == 'true') {
window.location.href = result[0].msg;
}
else {
alert(result[0].msg);
}
}
catch (ex) {
alert("Error: " + ex);
any help is appreciated! thank you-
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
// Call the web service method to display the Email Author JSP page for
// the Work Order email template. Result is an object with success="true" or "false"
// and msg = "error message or other string."
try {
var result = sforce.apex.execute(
'Work_Order_Buttons', // class name
'sendWorkOrder', // methodName
{
oppIdraw: "{!Work_Order__c.Id}"
}
);
if (result[0].success == 'true') {
window.location.href = result[0].msg;
}
else {
alert(result[0].msg);
}
}
catch (ex) {
alert("Error: " + ex);
any help is appreciated! thank you-
-
- Shamus Kelley 4
- June 12, 2018
- Like
- 0
- Continue reading or reply
Modifying OnClick java button to update additional field during its processing
I'm looking to update the script within this button so that a custom field (i.e. Quote_generated_coun__c) is updated every time the button is clicked. Any help is greatly appreciated!
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
this script currently generates a new PDF file each time the button is pushed and stores in on the opportunity as a new Attachment. I want to update a number filed (Quote_generated_count__c) on the opportunity record (where the button resides) to keep a count of how many times that button is pushed.
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
this script currently generates a new PDF file each time the button is pushed and stores in on the opportunity as a new Attachment. I want to update a number filed (Quote_generated_count__c) on the opportunity record (where the button resides) to keep a count of how many times that button is pushed.
-
- Shamus Kelley 4
- May 30, 2018
- Like
- 0
- Continue reading or reply
Update OnClick java script to populate a number filed (i.e. counter) to show how many times the button is pushed?
Hello -
I need to update the javascript within this button so that a custom field (i.e. counter__c) is updated every time the button is clicked. Any help is greatly appreciated!
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
I need to update the javascript within this button so that a custom field (i.e. counter__c) is updated every time the button is clicked. Any help is greatly appreciated!
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
-
- Shamus Kelley 4
- May 29, 2018
- Like
- 0
- Continue reading or reply
Process Builder flow - error
Hello -
I'm trying to update a number of opportunities via Data Loader but keep receiving an error message. hoping someone call help me resolve this.
the error message is: "The record couldn't be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30130000000PMSb. Contact your administrator for help."
i do have an active process builder flow but I don't see any issues with that one single record updates.
thank you in advance.
Shamus
I'm trying to update a number of opportunities via Data Loader but keep receiving an error message. hoping someone call help me resolve this.
the error message is: "The record couldn't be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30130000000PMSb. Contact your administrator for help."
i do have an active process builder flow but I don't see any issues with that one single record updates.
thank you in advance.
Shamus
-
- Shamus Kelley 4
- May 05, 2016
- Like
- 0
- Continue reading or reply
API call logs
Hello -
I'm looking to get insight into an API call that took place on a certain date for one of our connected apps. Is there a standard area to view this in or can this only be done in the developer console with a query?
thank you!
I'm looking to get insight into an API call that took place on a certain date for one of our connected apps. Is there a standard area to view this in or can this only be done in the developer console with a query?
thank you!
-
- Shamus Kelley 4
- February 22, 2016
- Like
- 0
- Continue reading or reply
Control/lock Custom OnClick Button while record is within approval process
How can I modify this code to prohibit custom button from functioning while record is within the approval process? See image for code detail. Also fire alert "Cannot use button while record is within the approval process"
thank you-
thank you-
-
- Shamus Kelley 4
- January 14, 2016
- Like
- 0
- Continue reading or reply
How to add a hyperlink to a visualforce email template
I have a visualforce email template that uses merge fields. Our sales users would like the Contact Name to be more than just text. They would like that particular field value to be a hyperlink to that record in salesforce. Is this possible? If so, how can that be done?
I've included an image of current code. I assume the adjustment would be made with the relatedTo.Name portion on line 14.
Thank you -
I've included an image of current code. I assume the adjustment would be made with the relatedTo.Name portion on line 14.
Thank you -
-
- Shamus Kelley 4
- January 05, 2016
- Like
- 0
- Continue reading or reply
Why would the Winter '15 release cause issue with preexisting code?
Hello - We expereinced an issue yesterday with a few of our OnClick Java buttons, which seemiling were related to the Winter 15 release for our Instance (NA1). I'm curious as to why preexisting code would have been affected. I'm not a developer but we were able to resolve with a few lines. I'm just curious as to what new upgrade caused this and how I could have been made aware of it before the issue came about.
Old Code:
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"false"
}
);
if (result[0].success == 'true') {
// window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
Updated Code:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"false"
}
);
if (result[0].success == 'true') {
// window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
thank you in advance!
Old Code:
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"false"
}
);
if (result[0].success == 'true') {
// window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
Updated Code:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"false"
}
);
if (result[0].success == 'true') {
// window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
thank you in advance!
-
- Shamus Kelley 4
- September 29, 2015
- Like
- 0
- Continue reading or reply
Incremental counter each time a custom button is clicked
I'm looking to track/count each time a custom button is clicked. i.e. each time Send Quote is clicked, i'd like to see the count go up incrementally. *This custom button is an onclick javascript. Thank you in advance.
-
- Shamus Kelley 4
- July 17, 2015
- Like
- 0
- Continue reading or reply
How can I modify this OnClick JavaScript so that it will also mark a custom checkbox field True while processing?
I have this OnClick java button that I need to modify so that it also marks a custom field True while processing. Here is the current code:
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
// Call the web service method to display the Email Author JSP page for
// the Work Order email template. Result is an object with success="true" or "false"
// and msg = "error message or other string."
try {
var result = sforce.apex.execute(
'Work_Order_Buttons', // class name
'sendWorkOrder', // methodName
{
oppIdraw: "{!Work_Order__c.Id}"
}
);
if (result[0].success == 'true') {
window.location.href = result[0].msg;
}
else {
alert(result[0].msg);
}
}
catch (ex) {
alert("Error: " + ex);
any help is appreciated! thank you-
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
// Call the web service method to display the Email Author JSP page for
// the Work Order email template. Result is an object with success="true" or "false"
// and msg = "error message or other string."
try {
var result = sforce.apex.execute(
'Work_Order_Buttons', // class name
'sendWorkOrder', // methodName
{
oppIdraw: "{!Work_Order__c.Id}"
}
);
if (result[0].success == 'true') {
window.location.href = result[0].msg;
}
else {
alert(result[0].msg);
}
}
catch (ex) {
alert("Error: " + ex);
any help is appreciated! thank you-
- Shamus Kelley 4
- June 12, 2018
- Like
- 0
- Continue reading or reply
Update OnClick java script to populate a number filed (i.e. counter) to show how many times the button is pushed?
Hello -
I need to update the javascript within this button so that a custom field (i.e. counter__c) is updated every time the button is clicked. Any help is greatly appreciated!
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
I need to update the javascript within this button so that a custom field (i.e. counter__c) is updated every time the button is clicked. Any help is greatly appreciated!
Here is the current OnClick Java Script that needs modification:
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/21.0/apex.js")}
try{
// check that Opp has the necessary approvals in order to continue
var strCheck = "{!Opportunity.Approval_Required__c}".toLowerCase();
if ( strCheck.indexOf("quote") == -1) {
try{
var result = sforce.apex.execute(
'Opportunity_Buttons', // class name
'createQuote', // method name
{ // arguments
oppIDraw:"{!Opportunity.Id}",
generateQuoteNum:"true"
}
);
if (result[0].success == 'true') {
//window.location = result[0].msg;
window.open(result[0].msg, "quoteWin");
} else alert(result[0].msg);
}
catch(ex){
alert("Error: "+ex);
}
} else alert("No Quote can be generated because Approvals are required");
}
catch (ex) {
alert("Error: " + ex);
}
- Shamus Kelley 4
- May 29, 2018
- Like
- 0
- Continue reading or reply
Process Builder flow - error
Hello -
I'm trying to update a number of opportunities via Data Loader but keep receiving an error message. hoping someone call help me resolve this.
the error message is: "The record couldn't be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30130000000PMSb. Contact your administrator for help."
i do have an active process builder flow but I don't see any issues with that one single record updates.
thank you in advance.
Shamus
I'm trying to update a number of opportunities via Data Loader but keep receiving an error message. hoping someone call help me resolve this.
the error message is: "The record couldn't be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 30130000000PMSb. Contact your administrator for help."
i do have an active process builder flow but I don't see any issues with that one single record updates.
thank you in advance.
Shamus
- Shamus Kelley 4
- May 05, 2016
- Like
- 0
- Continue reading or reply
API call logs
Hello -
I'm looking to get insight into an API call that took place on a certain date for one of our connected apps. Is there a standard area to view this in or can this only be done in the developer console with a query?
thank you!
I'm looking to get insight into an API call that took place on a certain date for one of our connected apps. Is there a standard area to view this in or can this only be done in the developer console with a query?
thank you!
- Shamus Kelley 4
- February 22, 2016
- Like
- 0
- Continue reading or reply
Incremental counter each time a custom button is clicked
I'm looking to track/count each time a custom button is clicked. i.e. each time Send Quote is clicked, i'd like to see the count go up incrementally. *This custom button is an onclick javascript. Thank you in advance.
- Shamus Kelley 4
- July 17, 2015
- Like
- 0
- Continue reading or reply