-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
13Questions
-
15Replies
Custom Field Value Changing On Its Own
With all that said, this field is continuously flipping back and forth between true/false values, often after another user has previously changed it and saved the record. We have a lot of 3rd party tools that sync with the Account object (AppExchange products/services), but this field is not a field that is synced between those programs so I've ruled out some sync-related errors as the root cause.
I do have field history tracking enabled for this field, and it shows me (the admin) as the culprit for these changes, but it's happening at times when I am either not in the system or not doing any sort of mass record changes that could trigger this field to be changed, even though I am not aware of anything that could be causing this.
Is there some way to more closely track & determine what exactly is causing this issue?
Thanks in advance!
-
- Brenzo
- April 06, 2017
- Like
- 0
- Continue reading or reply
Incremental Counter Not Counting Properly
Here is my code to update the counter field 'VelocifyResync':
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")} var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; var VelocifyResync = '{!Opportunity.Velocify_Resync__c}'; // assign values to fields on opportunity object opp.Velocify_Resync__c = VelocifyResync + 1; //save the change var result = sforce.connection.update([opp]); if(result[0].getBoolean("success")) { window.location.reload();; } else { alert('Error : '+result); }Appreciate any help here!
-
- Brenzo
- February 21, 2017
- Like
- 0
- Continue reading or reply
Execute Javascript Button to Display Alert that can be Acknowledge Prior to Proceeding
What I am trying to do is have an alert appear upon clicking if it is determined that a case for the same opportunity was opened within the past 'x' days. Ideally, this would then present the user with the option to 'Cancel' or 'Proceed' with the latter click taking them to the case creation/edit screen with the aforementioned values inputted.
My gut is telling me that this is going to require some apex triggers and potentially a VF page, but just wanted to see if there is some other (easier / capable of being done in-house) resources to achieve this.
Thanks in advance!
-
- Brenzo
- February 09, 2017
- Like
- 0
- Continue reading or reply
Case ownership is being transferred for NO (some) reason
The Problem
Case ownership is transferring between users and my default support queue without the user's input, however, it appears as if the user is the one transferring the case. This can occur minutes after they initially take ownership, and sometimes it happens several hours later. It occurs with both open and closed cases, the latter be especially frustrating since the newly assigned owner will go to work the case without realizing it's already been closed. I have also verified that this is happening both during and after hours - when users are no longer logged into the system - so I know that they are not the ones transferring the cases despite the Case feed suggesting otherwise.
Investigation Thus Far
Apex Triggers - Salesforce support suggested this was the cause, which makes sense, but I looked and there are no active Apex Triggers that I have written / implemented, which would cause this behavior. In fact, there are only three (3) Case object triggers, all of which are managed by installed packages, and none of which are desigend to do anything with regards to Case ownership (one is related to our mapping software and the other two are for a contest/gamification application)
Thank you.
Ben
-
- Brenzo
- November 23, 2016
- Like
- 0
- Continue reading or reply
Custom Javascript Button that Run (Edits Record) on Behalf of Designated User?
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")} var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; opp.Dataloader_Update_Date__c = '{!Opportunity.Dataloader_Update_Date__c}'; opp.Manager_Followed_Opportunity__c = '{!Opportunity.Manager_Followed_Opportunity__c}'; // assign values to fields on opportunity object opp.Dataloader_Update_Date__c = new Date(); opp.Manager_Followed_Opportunity__c = true; //save the change result = sforce.connection.update([opp]); //refresh the page window.location.reload();
I was thinking of designating the user as the system admin (using my user ID), but I couldn't get it working. Ultimately, I want it to work so that after the page refreshes, it shows the record as being last modified by myself and not the user who clicked the button.
Thanks in advance!
-
- Brenzo
- November 15, 2016
- Like
- 0
- Continue reading or reply
Validation Rule to Check for Multiple, Repeating Text strings
What I am attempting to do is fire a validation rule if more than one '@' symbol is found and no comma (',') is present. The idea being that if the user wants to insert multiple email addresses then it'll prompt them to ensure these are separated via comma. The reason for doing this vs. creating mutliple lookup or email fields is that there may be instances where a user wants to include multiple (5+ recipents) and I do not want to waste fields or space on the page layout for all these individual fields and would rather just have one section.
Even better would be a rule that would look for & count how many '@' symbols appear and then make sure there are the same number of corresponding commas (well, actually one less since you do not need a comma at the end.)
The validation rule would then state something along the lines of "Please separate multiple email addresses with a comma."
I appreciate in advance any help that anyone can provide!
-
- Brenzo
- August 12, 2016
- Like
- 0
- Continue reading or reply
Update Opportunity Field via Process Builder when Task Created
When I create the process, it doesn't appear possible to get to the related-to opportunity record.
Appreciate any help and insight that is provided.
-
- Brenzo
- March 01, 2016
- Like
- 0
- Continue reading or reply
Custom Javascript Button to Send Email Only Working for Certain Profiles
The problem I am running into is that the button works perfectly for myself and the other administrator, but simply refreshes the page for everyone else who clicks it.
Because of this, my assumption is that there must be a user setting or permission for the profile(s) of those who cannot trigger the button to send the email. I've gone through and turned settings on/off and tried to strip the button code down, but I still can't quite figure out what is causing this issue. My hunch says it's something with the SingleEmailMessage or sendEmail parameters of the code, but the user profile(s) in question have the abiltiy to send email and do just about everything else and they don't run into issues with other javascript codes.
Here is my code:
{!REQUIRESCRIPT("/soap/ajax/35.0/connection.js")} if( {!Contact.Outside_PartnerId__c = "a1sG0000005AeeS"}) { var message = new sforce.SingleEmailMessage(); message.replyTo = "{!User.Email}"; message.targetObjectId = "{!Contact.Id}"; message.templateId = "00XG0000001cZKS"; message.saveAsActivity = true; var result = sforce.connection.sendEmail([message]); } else{ alert('This button is only available for sending to Company X reps.'); } //refresh the page window.location.reload();
I really appreciate anyone's help or insight into this.
-
- Brenzo
- February 12, 2016
- Like
- 0
- Continue reading or reply
Updating Two Objects via OnClick Javascript Button with Combined Error Alert if Failed
I am struggling with getting the "if" logic to work at the end of my code to display the error(s) that might prevent this process for completing. This usually occurs as a result of validation rules on either the Opportunity or Account object.
Below is what I currently have:
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} //declare the variable that will hold all the information var opp = new sforce.SObject("Opportunity"); var acct = new sforce.SObject("Account"); var ssn = '{!Account.Sent_Suspension_Notice__c}'; //Check to see if the Account has been marked as being sent a suspension notice. if(ssn == '0') { alert("The account has not been marked as being sent a suspension notice (check box on Account page.) This must be done prior to moving forward with the suspension process."); } else{ //declare the variable that will hold all the information opp.Id = '{!Opportunity.Id}'; opp.Service_Suspended_Cancelled__c = '1'; opp.StageName = 'Service Suspended'; opp.Suspension_Date__c = new Date(); opp.RecordTypeId ='012G0000001QILv'; acct.Id = '{!Opportunity.AccountId}'; acct.Service_Suspended__c == '1'; //save the change var result1 = sforce.connection.update([opp]); var result2 = sforce.connection.update([acct]); if(and(((result1[0].getBoolean("success")),(result2[0].getBoolean("success"))) { alert("You have successfully initiated the suspension / cancellation process. Press OK to continue. "); } else { alert('Error : '+result); } //refresh the page window.location.reload();}
I'm trying to combine the two results and basically only display the "success" message if both objects were able to successfully update. If not, then I want to displa the error messages.
Any help would be GREATLY appreciated!
-
- Brenzo
- October 15, 2015
- Like
- 0
- Continue reading or reply
Onclick Javascript Button to Update Custom Checkbox on Opportunity Record
Here is the code I am currently working with:
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")} //declare the varaiable that will hold all the information var newRecords = []; var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; opp.Manager_Followed_Opportunity__c = '1'; //push the information through newRecords.push(opp); //save the change result = sforce.connection.update([opp]); //refresh the page window.location.reload();
I cannot get the box to become marked true (I have already tried changing
opp.Manager_Followed_Opportunity__c = '1'; to = true/True/'True'/'true' with no success.)
Thank you in advance for any help you can provide!
-
- Brenzo
- December 09, 2014
- Like
- 0
- Continue reading or reply
Execute Javascript Button to Create Contact Record from Related List (on Account Record)
- Create a new contact record, using values that appear in custom fields on the Account record where the button appears
- Update a check box field on the Account record
- Display a confirmation message
{!REQUIRESCRIPT("/soap/ajax/31.0/apex.js")}
var ContactObj = new sforce.SObject("Contact");
ContactObj.Account='{!Account.Id}';
ContactObj.FirstName='{!Account.AP_First_Name__c}';
ContactObj.LastName='{!Account.AP_Last_Name__c}';
ContactObj.Phone='{!Account.Accounts_Payable_Phone__c}';
ContactObj.Responsible_for_A_P__c='1';
var result = sforce.connection.create([ContactObj]);
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
So a couple problems...
First, I'm getting an error that 'Account' doesn't exist on the contact object, which obviously is not the case. What am I messing up here? I know it's something small.
Second, I don't how to get it so that upon successfully creating the contact record, to also update the custom check box field on the account page. Idealy I'd like this to happen in the background and refresh the page so that the user isn't taken to the contact record page.
Thanks in advance for any help!
-
- Brenzo
- September 12, 2014
- Like
- 0
- Continue reading or reply
OnClick Javascript Button to Display Alert AFTER Page Reload?
I have an OnClick Javascript button on the lead record that when clicked, changes the Lead status and refreshes the page. What'd I'd like is for a pop-up window to appear after the page refreshes displaying a message.
I started playing around with the .onload and .reload function, but the alerts I wrote kept appearing upon the button being clicked, not after the page refreshes/reloads. I just want something to pop up and say "Your lead has been updated."
Here's the bottom portion of my code:
// assign values to fields using LeadObj variable
LeadObj.Status = 'Inactive';
LeadObj.Status_Reason__c = 'Lead Unresponsive';
}
//save the change
var result = sforce.connection.update([LeadObj]);
//refresh the page
window.location.reload();
Thanks in advance for any help!
-
- Brenzo
- August 22, 2014
- Like
- 0
- Continue reading or reply
Updating Custom Object Look Up Field on Lead Record
So let me preface this by stating that I have searched the boards and Google in general and have not been able to find a simplified explanation for what I am trying to do. I have very limited coding skills and no experience when it comes to Apex triggers so I appreciate in advance any and all help you can provide. I will do my best to explain below what I am trying to do.
On my lead records, I have a look up field to a custom object called 'Distributors.' If a lead comes in from an outside distributor, then the internal sales rep can look up and add the appropriate distributor. Sometimes these outside distributors have co-branded web landing pages so that visitors can fill out a web form, which becomes a new lead record. What I need is a way to have the distributor automatically filled in, something that doesn't necessarily need to occur upon the initial record creation, but could happen following this initial creation or during the subsequent record editing.
What I have in mind is a hidden pick list with all distributors listed. The web form would be set to default to the specified distributor value and the apex trigger would then take the text of this value and insert it into the look up field. If this doesn't work because of the source being a pick list, then I could create a workflow that takes the pick list value and inserts it into a text box.
What I need help with is the basic code to make this happen as it's something that I will need to perhaps extend to campaigns and other custom objects that rely on the use of a look up fields on the lead record.
Once again, thank you in advance for taking the time to read this and for any help that can be provided.
-
- Brenzo
- May 20, 2013
- Like
- 0
- Continue reading or reply
Incremental Counter Not Counting Properly
Here is my code to update the counter field 'VelocifyResync':
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")} var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; var VelocifyResync = '{!Opportunity.Velocify_Resync__c}'; // assign values to fields on opportunity object opp.Velocify_Resync__c = VelocifyResync + 1; //save the change var result = sforce.connection.update([opp]); if(result[0].getBoolean("success")) { window.location.reload();; } else { alert('Error : '+result); }Appreciate any help here!
- Brenzo
- February 21, 2017
- Like
- 0
- Continue reading or reply
Case ownership is being transferred for NO (some) reason
The Problem
Case ownership is transferring between users and my default support queue without the user's input, however, it appears as if the user is the one transferring the case. This can occur minutes after they initially take ownership, and sometimes it happens several hours later. It occurs with both open and closed cases, the latter be especially frustrating since the newly assigned owner will go to work the case without realizing it's already been closed. I have also verified that this is happening both during and after hours - when users are no longer logged into the system - so I know that they are not the ones transferring the cases despite the Case feed suggesting otherwise.
Investigation Thus Far
Apex Triggers - Salesforce support suggested this was the cause, which makes sense, but I looked and there are no active Apex Triggers that I have written / implemented, which would cause this behavior. In fact, there are only three (3) Case object triggers, all of which are managed by installed packages, and none of which are desigend to do anything with regards to Case ownership (one is related to our mapping software and the other two are for a contest/gamification application)
Thank you.
Ben
- Brenzo
- November 23, 2016
- Like
- 0
- Continue reading or reply
Custom Javascript Button that Run (Edits Record) on Behalf of Designated User?
Here is the code:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")} var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; opp.Dataloader_Update_Date__c = '{!Opportunity.Dataloader_Update_Date__c}'; opp.Manager_Followed_Opportunity__c = '{!Opportunity.Manager_Followed_Opportunity__c}'; // assign values to fields on opportunity object opp.Dataloader_Update_Date__c = new Date(); opp.Manager_Followed_Opportunity__c = true; //save the change result = sforce.connection.update([opp]); //refresh the page window.location.reload();
I was thinking of designating the user as the system admin (using my user ID), but I couldn't get it working. Ultimately, I want it to work so that after the page refreshes, it shows the record as being last modified by myself and not the user who clicked the button.
Thanks in advance!
- Brenzo
- November 15, 2016
- Like
- 0
- Continue reading or reply
Validation Rule to Check for Multiple, Repeating Text strings
What I am attempting to do is fire a validation rule if more than one '@' symbol is found and no comma (',') is present. The idea being that if the user wants to insert multiple email addresses then it'll prompt them to ensure these are separated via comma. The reason for doing this vs. creating mutliple lookup or email fields is that there may be instances where a user wants to include multiple (5+ recipents) and I do not want to waste fields or space on the page layout for all these individual fields and would rather just have one section.
Even better would be a rule that would look for & count how many '@' symbols appear and then make sure there are the same number of corresponding commas (well, actually one less since you do not need a comma at the end.)
The validation rule would then state something along the lines of "Please separate multiple email addresses with a comma."
I appreciate in advance any help that anyone can provide!
- Brenzo
- August 12, 2016
- Like
- 0
- Continue reading or reply
Custom Javascript Button to Send Email Only Working for Certain Profiles
The problem I am running into is that the button works perfectly for myself and the other administrator, but simply refreshes the page for everyone else who clicks it.
Because of this, my assumption is that there must be a user setting or permission for the profile(s) of those who cannot trigger the button to send the email. I've gone through and turned settings on/off and tried to strip the button code down, but I still can't quite figure out what is causing this issue. My hunch says it's something with the SingleEmailMessage or sendEmail parameters of the code, but the user profile(s) in question have the abiltiy to send email and do just about everything else and they don't run into issues with other javascript codes.
Here is my code:
{!REQUIRESCRIPT("/soap/ajax/35.0/connection.js")} if( {!Contact.Outside_PartnerId__c = "a1sG0000005AeeS"}) { var message = new sforce.SingleEmailMessage(); message.replyTo = "{!User.Email}"; message.targetObjectId = "{!Contact.Id}"; message.templateId = "00XG0000001cZKS"; message.saveAsActivity = true; var result = sforce.connection.sendEmail([message]); } else{ alert('This button is only available for sending to Company X reps.'); } //refresh the page window.location.reload();
I really appreciate anyone's help or insight into this.
- Brenzo
- February 12, 2016
- Like
- 0
- Continue reading or reply
Updating Two Objects via OnClick Javascript Button with Combined Error Alert if Failed
I am struggling with getting the "if" logic to work at the end of my code to display the error(s) that might prevent this process for completing. This usually occurs as a result of validation rules on either the Opportunity or Account object.
Below is what I currently have:
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/33.0/apex.js")} //declare the variable that will hold all the information var opp = new sforce.SObject("Opportunity"); var acct = new sforce.SObject("Account"); var ssn = '{!Account.Sent_Suspension_Notice__c}'; //Check to see if the Account has been marked as being sent a suspension notice. if(ssn == '0') { alert("The account has not been marked as being sent a suspension notice (check box on Account page.) This must be done prior to moving forward with the suspension process."); } else{ //declare the variable that will hold all the information opp.Id = '{!Opportunity.Id}'; opp.Service_Suspended_Cancelled__c = '1'; opp.StageName = 'Service Suspended'; opp.Suspension_Date__c = new Date(); opp.RecordTypeId ='012G0000001QILv'; acct.Id = '{!Opportunity.AccountId}'; acct.Service_Suspended__c == '1'; //save the change var result1 = sforce.connection.update([opp]); var result2 = sforce.connection.update([acct]); if(and(((result1[0].getBoolean("success")),(result2[0].getBoolean("success"))) { alert("You have successfully initiated the suspension / cancellation process. Press OK to continue. "); } else { alert('Error : '+result); } //refresh the page window.location.reload();}
I'm trying to combine the two results and basically only display the "success" message if both objects were able to successfully update. If not, then I want to displa the error messages.
Any help would be GREATLY appreciated!
- Brenzo
- October 15, 2015
- Like
- 0
- Continue reading or reply
Onclick Javascript Button to Update Custom Checkbox on Opportunity Record
Here is the code I am currently working with:
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")} //declare the varaiable that will hold all the information var newRecords = []; var opp = new sforce.SObject("Opportunity"); opp.Id = '{!Opportunity.Id}'; opp.Manager_Followed_Opportunity__c = '1'; //push the information through newRecords.push(opp); //save the change result = sforce.connection.update([opp]); //refresh the page window.location.reload();
I cannot get the box to become marked true (I have already tried changing
opp.Manager_Followed_Opportunity__c = '1'; to = true/True/'True'/'true' with no success.)
Thank you in advance for any help you can provide!
- Brenzo
- December 09, 2014
- Like
- 0
- Continue reading or reply
Execute Javascript Button to Create Contact Record from Related List (on Account Record)
- Create a new contact record, using values that appear in custom fields on the Account record where the button appears
- Update a check box field on the Account record
- Display a confirmation message
{!REQUIRESCRIPT("/soap/ajax/31.0/apex.js")}
var ContactObj = new sforce.SObject("Contact");
ContactObj.Account='{!Account.Id}';
ContactObj.FirstName='{!Account.AP_First_Name__c}';
ContactObj.LastName='{!Account.AP_Last_Name__c}';
ContactObj.Phone='{!Account.Accounts_Payable_Phone__c}';
ContactObj.Responsible_for_A_P__c='1';
var result = sforce.connection.create([ContactObj]);
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
So a couple problems...
First, I'm getting an error that 'Account' doesn't exist on the contact object, which obviously is not the case. What am I messing up here? I know it's something small.
Second, I don't how to get it so that upon successfully creating the contact record, to also update the custom check box field on the account page. Idealy I'd like this to happen in the background and refresh the page so that the user isn't taken to the contact record page.
Thanks in advance for any help!
- Brenzo
- September 12, 2014
- Like
- 0
- Continue reading or reply
OnClick Javascript Button to Display Alert AFTER Page Reload?
I have an OnClick Javascript button on the lead record that when clicked, changes the Lead status and refreshes the page. What'd I'd like is for a pop-up window to appear after the page refreshes displaying a message.
I started playing around with the .onload and .reload function, but the alerts I wrote kept appearing upon the button being clicked, not after the page refreshes/reloads. I just want something to pop up and say "Your lead has been updated."
Here's the bottom portion of my code:
// assign values to fields using LeadObj variable
LeadObj.Status = 'Inactive';
LeadObj.Status_Reason__c = 'Lead Unresponsive';
}
//save the change
var result = sforce.connection.update([LeadObj]);
//refresh the page
window.location.reload();
Thanks in advance for any help!
- Brenzo
- August 22, 2014
- Like
- 0
- Continue reading or reply
Updating Custom Object Look Up Field on Lead Record
So let me preface this by stating that I have searched the boards and Google in general and have not been able to find a simplified explanation for what I am trying to do. I have very limited coding skills and no experience when it comes to Apex triggers so I appreciate in advance any and all help you can provide. I will do my best to explain below what I am trying to do.
On my lead records, I have a look up field to a custom object called 'Distributors.' If a lead comes in from an outside distributor, then the internal sales rep can look up and add the appropriate distributor. Sometimes these outside distributors have co-branded web landing pages so that visitors can fill out a web form, which becomes a new lead record. What I need is a way to have the distributor automatically filled in, something that doesn't necessarily need to occur upon the initial record creation, but could happen following this initial creation or during the subsequent record editing.
What I have in mind is a hidden pick list with all distributors listed. The web form would be set to default to the specified distributor value and the apex trigger would then take the text of this value and insert it into the look up field. If this doesn't work because of the source being a pick list, then I could create a workflow that takes the pick list value and inserts it into a text box.
What I need help with is the basic code to make this happen as it's something that I will need to perhaps extend to campaigns and other custom objects that rely on the use of a look up fields on the lead record.
Once again, thank you in advance for taking the time to read this and for any help that can be provided.
- Brenzo
- May 20, 2013
- Like
- 0
- Continue reading or reply
Update "Salesforce International Mapping using Google Maps" to use API v3 and SSL?
Hi,
"Salesforce International Mapping using Google Maps" (https://sites.secure.force.com/appexchange/listingDetail?listingId=a0N300000016d25EAA) is a great, simple app, but it uses version 2 of the gmaps API, which is (a) deprecated, and (b) served over HTTP, which causes SSL errors on modern browsers since SFDC is served over HTTPS.
Is anyone working on updating the app to use the new version of the Google Maps API?
Thanks,
Benj
- BenjK
- March 13, 2012
- Like
- 0
- Continue reading or reply