• Adriana Voyce
  • NEWBIE
  • 45 Points
  • Member since 2014
  • Salesforce Administrator


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 16
    Questions
  • 20
    Replies
Hello All, 

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);
}
}}
I am receiving the following error: We can't save this record because the “Quote Line Updates” process failed. Give your Salesforce admin these details. <b>An unhandled fault has occurred in this flow</b><br>An unhandled fault has occurred while processing the flow.  Please contact your system administrator for more information. Error ID: 9681222-24286 (937709402): []

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
 
Hi All, 

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? 
Hi All, 

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. 

User-added image
Hi All, 

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? 
Hi! I created a button that is supposed to check a checkbox on an opportunity and open a window which allows a use to download a docoument....

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')();

User-added image
I would like to have a screen or something show up when someone submits a quote for approval so they can write in the justification for the discount. Similar to the screnshot below... Could something similar be accomplished through a flow? Or would it requiere a visual force page? Or is there another idea? 

User-added image
We use ringlead internally to help maintain data integrity, and have over written the new button so that when new is clicked ringlead evaluates the record. 

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 >
 
I want a button on Soltuions to be able to email me when a Soltuion needs to be udpated.  I have the following link
/_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=00X19000000QFda
The 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!
 
I am trying to create a button that will update the stage of an opportunity to a specific stage, and the owner to whom ever clicks the button, additionally I want the update to happen only if a specific profile clicks the button (this may be best accomplished through a validation rule though so its not in my code) 

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();