-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
1Likes Given
-
16Questions
-
20Replies
We can't save this record because the “Lead: Auto Convert” process failed. Give your Salesforce admin these details. An Apex error occurred: System.LimitException: Too many query rows: 50001
I have a trigger I created to auto-convert a lead. Basically, when a box is checked on a lead, it kicks off process builder to convert the lead. It used to work just fine but a couple of months ago it stopped working. Any idea why? How can I fix this? Any help would be gretly appreciated!
Public class AutoConvertLeads
{
@InvocableMethod
public static void LeadAssign(List<Id> LeadIds)
{
LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();
List<Lead> myLeads = [Select id, name, Studio_Sync_Account_ID__c, Stripped_Website__c, website, company from Lead where id IN:LeadIds];
for (Lead l:myLeads){
}
List<Account> matchAccount = [Select id, Account_Classification__c, Full_ID__c, Stripped_Website__c, website, Name from account ];
for(Lead currentlead: myLeads){
for (Account a:matchAccount){
if (currentlead.Studio_Sync_Account_ID__c== a.Full_ID__c){
Database.LeadConvert Leadconvert = new Database.LeadConvert();
Leadconvert.setLeadId(currentlead.id);
Leadconvert.setAccountId(a.id);
Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);
Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to create an opportunity from Lead Conversion
MassLeadconvert.add(Leadconvert);
Break;
}
}
}
if (!MassLeadconvert.isEmpty()) {
List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);
}
}}
-
- Adriana Voyce
- March 18, 2020
- Like
- 0
- Continue reading or reply
Pinned Header in Custom Lightning Page Template
https://developer.salesforce.com/blogs/2018/08/all-about-custom-lightning-page-templates.html
The issue is I need the header to be pinned so that component in the header region scrolls down as the user scrolls down.
Any suggestions?
-
- Adriana Voyce
- December 19, 2019
- Like
- 0
- Continue reading or reply
CSS in community
In lighting knowledge communities I am using CSS to remove the field labels since title and URL cannot not be removed from the page layout or via field level security.
The code I am using below is removing the summary and meta data info and the labels. The problem I am having is when I use .uiOutputText - it gets rid of the additional text from title and URL which I want, but it is also removing the text from the pill which I don't want. Additionally I cannot seem to get rid of the grey lines that separate the text.
I have tried various things and this is the closest I get. Any ideas?
Code:
.selfServiceArticleLayout .article-summary{display:none;}
.meta{display:none;}
.test-id__field-label{display:none;}
.uiOutputText{display:none;}
Output:
-
- Adriana Voyce
- October 24, 2019
- Like
- 0
- Continue reading or reply
Missing flow
I have checked EVERYWHERE for this flow. It is not, in the list of processes under process builder. There a no visual workflows either. I have looked in the developer work bench and while all of my other processes show up there this one does not. How/Where could this be hinding????
Flow Details
Flow Name: Quote_Line_Updates
Type: Record Change Process
Version: 1
Status: Active
-
- Adriana Voyce
- June 21, 2018
- Like
- 0
- Continue reading or reply
Schedule Birthday Batch - Check Box
I have a series of workflows with email alerts and filed updates for birthdays the details are here: https://help.salesforce.com/articleView?id=000181218&language=en_US&type=1
The problem with this is that it requieres a mass update of all my records which puts thousands of records in time based workflow queue and interferes with other time based workflows that I have.
What I would like to do it the following: I have a formula that calculates "Next birthday Date" - I would like to have a scheduled batch that runs every night and for records that match that date - I want them to be checked with a checkbox that will kickoff the worklfows. I am using both regular contacts and person accounts so this needs to work on both or it has to be 2 different ones and thats ok, but I have NO IDEA!!! how to do something like this... Does any one know?
-
- Adriana Voyce
- June 29, 2017
- Like
- 0
- Continue reading or reply
Apex Class Approval Processes ActorID, OriginalActorid, and SystemModstamp to display names and Est - and adjust Controller columns
Please keep your responses as simple as possible, I am learning :)
I created A Class, A controller, and a VF template to display the approval process details, however... The values returned are UserIDs and GMT time stamp - Additionally I can't seem to get a nice table in my visualforce template it doesn't seem to respect the percentages I give it or setting it to 100%. Image of wants below along with my code.
I assume I need to tell my class to give me the Actorname but thats not one of the values I can pull from = getApprovalSteps not sure how to accomplsih this or do I do this somwhere else?
Class:
public class OpportunityApprovalHistoryController {
public String opptyId {get;set;}
public List<ProcessInstanceHistory> getApprovalSteps()
{if (opptyId != null) {Opportunity quote =
[Select Id,
(Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending,
IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc)
from Opportunity where Id = :opptyId];
return quote.ProcessSteps;}
return new List<ProcessInstanceHistory> ();}}
Controller:
<apex:component controller="OpportunityApprovalHistoryController" access="global">
<apex:attribute name="oppId" assignTo="{!opptyId}" type="String" description="Id of the opportunity"/>
<apex:dataTable value="{!approvalSteps}" var="step">
<style></style>
<apex:facet name="caption">Approval History</apex:facet>
<apex:facet name="header">Details</apex:facet>
<apex:column width="20%">
<apex:facet name="header">Date</apex:facet>
<apex:outputText value="{!step.SystemModstamp}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Status</apex:facet>
<apex:outputText value="{!step.StepStatus}"/>
</apex:column>
<apex:column width="20%" >
<apex:facet name="header">Assigned To</apex:facet>
<apex:outputText value="{!step.OriginalActorid}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Actual Approver</apex:facet>
<apex:outputText value="{!step.ActorID}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Comments</apex:facet>
<apex:outputText value="{!step.Comments}"/>
</apex:column>
</apex:dataTable>
</apex:component>
VF Template
<messaging:emailTemplate subject="Opportunity {!relatedTo.Name} Submitted for {!relatedTo.Subscription_Discount_Percent__c}% Subscription Discount" recipientType="User" relatedToType="Opportunity">
<messaging:HtmlEmailBody >
<p>Hello {!recipient.Name},</p>
<p>Opportunity: {!relatedTo.Name} for {!relatedTo.Account.Name} has been submitted for approval: </p>
<html>
<head>
<meta content="text/css;charset=utf-8" http-equiv="Content-Type"/>
<meta name="Template" content="Response"/>
</head>
<body>
<p><b>Approval History</b>
<c:opportunityapprovalhistory oppId="{!relatedTo.Id}" />
</p>
</body>
</html>
</messaging:HtmlEmailBody>
</messaging:emailTemplate>
WHAT I WANT
User full name not ID; Date in this format 5/16/2017 Est, and columns that auto size to the text along with borders on the table.
-
- Adriana Voyce
- May 16, 2017
- Like
- 0
- Continue reading or reply
Customize columns on Visualforce Page or related list
<apex:page standardController="MyMasterObject__c">
<apex:relatedList list="MyChildObjects__r" />
</apex:page>
-
- Adriana Voyce
- December 09, 2016
- Like
- 0
- Continue reading or reply
Make Visualforce display related list only and not clickable
I created a visualforce page to display a related list from a custom object. It looks great and I was able to remove the edit links as well. I would like however for the list to be read only though. I want the page to show the columns and details but I do not want the user to be able to click on the record reference to try to navigate to it. If they click on the VF page I do not want anything to happen.
Here is my code for the page. I tried readOnly="True" but it does not seem to work.
<apex:page standardController="SBQQ__Quote__c" readOnly="true"> <apex:relatedList list="SBQQ__LineItems__r" /> <style> [Class*='actionColumn'] { display:none; visibility:hidden; } </style> <style> [Class*='linkSpan'] { display:none; visibility:hidden; } </style> </apex:page>
Any suggestions?
-
- Adriana Voyce
- December 09, 2016
- Like
- 0
- Continue reading or reply
Rich Text Images from Solution into Email
-
- Adriana Voyce
- November 05, 2015
- Like
- 0
- Continue reading or reply
Javascript error on working button
The button works, the checkbox is checked and the window pops up to download, but when I click the button an error appears first and then the window pops up... How do I get rid of this error?
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity");
c.id ="{!Opportunity.Id}";
c.Voice_Referal__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.replace('/apex/SDOC__SDCreate1?id={!Opportunity.Id}&Object=Opportunity')();
-
- Adriana Voyce
- July 21, 2015
- Like
- 0
- Continue reading or reply
Make Billing Contact Role required
trigger updatecontactrolecount on Opportunity (before insert, before update)
{
Boolean isPrimary;
Integer iCount;
Map<String, Opportunity> oppty_con = new Map<String, Opportunity>();//check if the contact role is needed and add it to the oppty_con map
for (Integer i = 0; i < Trigger.new.size(); i++)
{
oppty_con.put(Trigger.new[i].id,
Trigger.new[i]);
}
isPrimary = False;
for (List<OpportunityContactRole> oppcntctrle :[select OpportunityId from OpportunityContactRole where (OpportunityContactRole.IsPrimary = True and OpportunityContactRole.OpportunityId in :oppty_con.keySet())])
{
if (oppcntctrle .Size() >0)
{
isPrimary = True;
}
}
iCount = 0;
for (List<OpportunityContactRole> oppcntctrle2 : [select OpportunityId from OpportunityContactRole where (OpportunityContactRole.OpportunityId in :oppty_con.keySet())])//Query for Contact Roles
{
if (oppcntctrle2 .Size()>0)
{
iCount= oppcntctrle2 .Size();
}
}
for (Opportunity Oppty : system.trigger.new) //Check if roles exist in the map or contact role isn't required
{
Oppty.Number_of_Contacts_Roles_Assigned__c = iCount;
Oppty.Primary_Contact_Assigned__c =isPrimary;
}
}
-
- Adriana Voyce
- June 25, 2015
- Like
- 0
- Continue reading or reply
Reason for Approval screen
-
- Adriana Voyce
- June 03, 2015
- Like
- 0
- Continue reading or reply
Visualforce page to bring in Standard Lead creation page
The problem is that in our partner community the same button is used and the end user receives an error. The only way to prevent this from happening would be to create a new button that is assigned only to the partner profiles, which I can do, but I need it to call a VF page which would be the lead creation page.
How can I recreate the lead creation page trought visual force so that partners can create leads. I am novice to developing so my knowledge is very limited and I cannot figure out the code... I need to do it for a coupoe other objects as well.
Any help would be greatly appreciated... All I have written is
<apex:page standardcontroller="Lead" tabstyle="Lead"> <apex:form >
-
- Adriana Voyce
- May 14, 2015
- Like
- 0
- Continue reading or reply
JS button to update Opportunity "Unexpected Token Illegal"
This is what I have written just trying to get the stage to change.... I get this error: "Unexpected Token Illegal"
***Note*** I am not a developer but trying to learn so my knoweledge is mimited
{!requireScript("/soap/ajax/10.0/connection.js")};
sforce.connection.session = "{!$Api.Session_ID}";
function updateOpportunity( )
{
try
{
var opp = new sforce.SObject(“Opportunity”);
opp.id =”{!Opportunity.Id}”;
opp.StageName = "AE Qualified”;
var saveResult = sforce.connection.update([Opportunity]);
if (result[0].getBoolean("success") == false ) {
alert(result[0].errors.message);
return;
}
window.top.location.href=window.top.location.href;
}
catch (e) {
alert(e);
}
}
updateOpportunity();
-
- Adriana Voyce
- March 04, 2015
- Like
- 0
- Continue reading or reply
Maildrop Errors
Any ideas as to how to fix this? Is there a way to do a complete uninstall like there is for Salesforce for Outlook deleteing the DB folder? Or any other way to fix this?
-
- Adriana Voyce
- February 13, 2015
- Like
- 0
- Continue reading or reply
MIXED_DML_OPERATION... System.runAs
Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger autostaff caused an unexpected exception, contact your administrator: autostaff: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Staff__c, original object: User: []: Trigger.autostaff: line 19, column 1
My trigger is written as follows:If creates a record on the staff object when a user is created
trigger autostaff on User (after insert) {
List <Staff__c> newstaff = new list <Staff__c> ();
for (User U : Trigger.new){
Staff__c Staff = new Staff__c();
Staff.Employee__c = U.ID;
Staff.Name = U.Full_Name__c;
newstaff.add(Staff);
}
insert newStaff;
}
From what I have read I need a to add System.runAs as part of my code, but I am not sure how that should be writttten...
Any help is appreaciated.... Please and thank you :)
-
- Adriana Voyce
- November 05, 2014
- Like
- 0
- Continue reading or reply
We can't save this record because the “Lead: Auto Convert” process failed. Give your Salesforce admin these details. An Apex error occurred: System.LimitException: Too many query rows: 50001
I have a trigger I created to auto-convert a lead. Basically, when a box is checked on a lead, it kicks off process builder to convert the lead. It used to work just fine but a couple of months ago it stopped working. Any idea why? How can I fix this? Any help would be gretly appreciated!
Public class AutoConvertLeads
{
@InvocableMethod
public static void LeadAssign(List<Id> LeadIds)
{
LeadStatus CLeadStatus= [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
List<Database.LeadConvert> MassLeadconvert = new List<Database.LeadConvert>();
List<Lead> myLeads = [Select id, name, Studio_Sync_Account_ID__c, Stripped_Website__c, website, company from Lead where id IN:LeadIds];
for (Lead l:myLeads){
}
List<Account> matchAccount = [Select id, Account_Classification__c, Full_ID__c, Stripped_Website__c, website, Name from account ];
for(Lead currentlead: myLeads){
for (Account a:matchAccount){
if (currentlead.Studio_Sync_Account_ID__c== a.Full_ID__c){
Database.LeadConvert Leadconvert = new Database.LeadConvert();
Leadconvert.setLeadId(currentlead.id);
Leadconvert.setAccountId(a.id);
Leadconvert.setConvertedStatus(CLeadStatus.MasterLabel);
Leadconvert.setDoNotCreateOpportunity(TRUE); //Remove this line if you want to create an opportunity from Lead Conversion
MassLeadconvert.add(Leadconvert);
Break;
}
}
}
if (!MassLeadconvert.isEmpty()) {
List<Database.LeadConvertResult> lcr = Database.convertLead(MassLeadconvert);
}
}}
- Adriana Voyce
- March 18, 2020
- Like
- 0
- Continue reading or reply
Missing flow
I have checked EVERYWHERE for this flow. It is not, in the list of processes under process builder. There a no visual workflows either. I have looked in the developer work bench and while all of my other processes show up there this one does not. How/Where could this be hinding????
Flow Details
Flow Name: Quote_Line_Updates
Type: Record Change Process
Version: 1
Status: Active
- Adriana Voyce
- June 21, 2018
- Like
- 0
- Continue reading or reply
Schedule Birthday Batch - Check Box
I have a series of workflows with email alerts and filed updates for birthdays the details are here: https://help.salesforce.com/articleView?id=000181218&language=en_US&type=1
The problem with this is that it requieres a mass update of all my records which puts thousands of records in time based workflow queue and interferes with other time based workflows that I have.
What I would like to do it the following: I have a formula that calculates "Next birthday Date" - I would like to have a scheduled batch that runs every night and for records that match that date - I want them to be checked with a checkbox that will kickoff the worklfows. I am using both regular contacts and person accounts so this needs to work on both or it has to be 2 different ones and thats ok, but I have NO IDEA!!! how to do something like this... Does any one know?
- Adriana Voyce
- June 29, 2017
- Like
- 0
- Continue reading or reply
Apex Class Approval Processes ActorID, OriginalActorid, and SystemModstamp to display names and Est - and adjust Controller columns
Please keep your responses as simple as possible, I am learning :)
I created A Class, A controller, and a VF template to display the approval process details, however... The values returned are UserIDs and GMT time stamp - Additionally I can't seem to get a nice table in my visualforce template it doesn't seem to respect the percentages I give it or setting it to 100%. Image of wants below along with my code.
I assume I need to tell my class to give me the Actorname but thats not one of the values I can pull from = getApprovalSteps not sure how to accomplsih this or do I do this somwhere else?
Class:
public class OpportunityApprovalHistoryController {
public String opptyId {get;set;}
public List<ProcessInstanceHistory> getApprovalSteps()
{if (opptyId != null) {Opportunity quote =
[Select Id,
(Select TargetObjectId, SystemModstamp, StepStatus, RemindersSent, ProcessInstanceId, OriginalActorId, IsPending,
IsDeleted, Id, CreatedDate, CreatedById, Comments, ActorId From ProcessSteps order by SystemModstamp desc)
from Opportunity where Id = :opptyId];
return quote.ProcessSteps;}
return new List<ProcessInstanceHistory> ();}}
Controller:
<apex:component controller="OpportunityApprovalHistoryController" access="global">
<apex:attribute name="oppId" assignTo="{!opptyId}" type="String" description="Id of the opportunity"/>
<apex:dataTable value="{!approvalSteps}" var="step">
<style></style>
<apex:facet name="caption">Approval History</apex:facet>
<apex:facet name="header">Details</apex:facet>
<apex:column width="20%">
<apex:facet name="header">Date</apex:facet>
<apex:outputText value="{!step.SystemModstamp}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Status</apex:facet>
<apex:outputText value="{!step.StepStatus}"/>
</apex:column>
<apex:column width="20%" >
<apex:facet name="header">Assigned To</apex:facet>
<apex:outputText value="{!step.OriginalActorid}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Actual Approver</apex:facet>
<apex:outputText value="{!step.ActorID}"/>
</apex:column>
<apex:column width="20%">
<apex:facet name="header">Comments</apex:facet>
<apex:outputText value="{!step.Comments}"/>
</apex:column>
</apex:dataTable>
</apex:component>
VF Template
<messaging:emailTemplate subject="Opportunity {!relatedTo.Name} Submitted for {!relatedTo.Subscription_Discount_Percent__c}% Subscription Discount" recipientType="User" relatedToType="Opportunity">
<messaging:HtmlEmailBody >
<p>Hello {!recipient.Name},</p>
<p>Opportunity: {!relatedTo.Name} for {!relatedTo.Account.Name} has been submitted for approval: </p>
<html>
<head>
<meta content="text/css;charset=utf-8" http-equiv="Content-Type"/>
<meta name="Template" content="Response"/>
</head>
<body>
<p><b>Approval History</b>
<c:opportunityapprovalhistory oppId="{!relatedTo.Id}" />
</p>
</body>
</html>
</messaging:HtmlEmailBody>
</messaging:emailTemplate>
WHAT I WANT
User full name not ID; Date in this format 5/16/2017 Est, and columns that auto size to the text along with borders on the table.
- Adriana Voyce
- May 16, 2017
- Like
- 0
- Continue reading or reply
Make Visualforce display related list only and not clickable
I created a visualforce page to display a related list from a custom object. It looks great and I was able to remove the edit links as well. I would like however for the list to be read only though. I want the page to show the columns and details but I do not want the user to be able to click on the record reference to try to navigate to it. If they click on the VF page I do not want anything to happen.
Here is my code for the page. I tried readOnly="True" but it does not seem to work.
<apex:page standardController="SBQQ__Quote__c" readOnly="true"> <apex:relatedList list="SBQQ__LineItems__r" /> <style> [Class*='actionColumn'] { display:none; visibility:hidden; } </style> <style> [Class*='linkSpan'] { display:none; visibility:hidden; } </style> </apex:page>
Any suggestions?
- Adriana Voyce
- December 09, 2016
- Like
- 0
- Continue reading or reply
Javascript error on working button
The button works, the checkbox is checked and the window pops up to download, but when I click the button an error appears first and then the window pops up... How do I get rid of this error?
{!REQUIRESCRIPT("/soap/ajax/22.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject("Opportunity");
c.id ="{!Opportunity.Id}";
c.Voice_Referal__c = true;
newRecords.push(c);
result = sforce.connection.update(newRecords);
window.location.replace('/apex/SDOC__SDCreate1?id={!Opportunity.Id}&Object=Opportunity')();
- Adriana Voyce
- July 21, 2015
- Like
- 0
- Continue reading or reply
Reason for Approval screen
- Adriana Voyce
- June 03, 2015
- Like
- 0
- Continue reading or reply
Visualforce page to bring in Standard Lead creation page
The problem is that in our partner community the same button is used and the end user receives an error. The only way to prevent this from happening would be to create a new button that is assigned only to the partner profiles, which I can do, but I need it to call a VF page which would be the lead creation page.
How can I recreate the lead creation page trought visual force so that partners can create leads. I am novice to developing so my knowledge is very limited and I cannot figure out the code... I need to do it for a coupoe other objects as well.
Any help would be greatly appreciated... All I have written is
<apex:page standardcontroller="Lead" tabstyle="Lead"> <apex:form >
- Adriana Voyce
- May 14, 2015
- Like
- 0
- Continue reading or reply
button to update fields and send email
/_ui/core/email/author/EmailAuthor?p3_lkid={!Solution.Id}&retURL=%2F{!Solution.Id}&{!(ISPICKVAL(Solution.Status, "Needs Update"))}&p5="gilmore_staci@cat.com"&p24="mansfield_matthew@cat.com"&template_id=00X19000000QFdaThe email send fine, but I can't get the fields to update. I have it trying to change the Status field to Needs Update. How can I get it to do this?
Status is a picklist. I also want a checkbox to uncheck. TIA!
- Staci
- March 11, 2015
- Like
- 0
- Continue reading or reply
JS button to update Opportunity "Unexpected Token Illegal"
This is what I have written just trying to get the stage to change.... I get this error: "Unexpected Token Illegal"
***Note*** I am not a developer but trying to learn so my knoweledge is mimited
{!requireScript("/soap/ajax/10.0/connection.js")};
sforce.connection.session = "{!$Api.Session_ID}";
function updateOpportunity( )
{
try
{
var opp = new sforce.SObject(“Opportunity”);
opp.id =”{!Opportunity.Id}”;
opp.StageName = "AE Qualified”;
var saveResult = sforce.connection.update([Opportunity]);
if (result[0].getBoolean("success") == false ) {
alert(result[0].errors.message);
return;
}
window.top.location.href=window.top.location.href;
}
catch (e) {
alert(e);
}
}
updateOpportunity();
- Adriana Voyce
- March 04, 2015
- Like
- 0
- Continue reading or reply
Trigger on User object to create another record
Hiya,
Im after some advice on what i think is going to be a pretty simple bit of code. Basically i want to write a trigger on the User object that will insert a record into a separate Staff__c object with details of the user just saved. I was unsure how to pull the details of the user just saved.
Here is some rough pseudo code! Unsure if it would even work with something along these lines? But il give it a try while waiting if anyone else has a better idea :) (updated code, works even though its rough :) )
Just need to work out how to get it to fire only once!
trigger userToStaff on User (after insert, after update) {
List<Staff__c> staffToUpdate = new List<Staff__c>();
for (User usr : Trigger.new) {
Staff__c staff = new Staff__c (
//User_ID__c = usr.Id
First_Name__c = usr.Name
);
staffToUpdate.add(staff);
}
if(staffToUpdate.size()>0){
try {
insert staffToUpdate;
} catch (exception e) {
system.debug(e.getMessage());
}
}
}
Any advice would be great!!! :)
Regards
Michael
- Brookesy--
- December 21, 2009
- Like
- 1
- Continue reading or reply