• Nikhil_Khetan
  • NEWBIE
  • 155 Points
  • Member since 2013
  • Director
  • CloudRoute Solutions


  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 29
    Replies
Our standard 'New Opportunity' button is overriden to invoke a visualforce page. Can I create a different 'New Opportunity' button for use only on the Account screen's Opportunity Related List which does NOT invoke that invoke that same visualforce page. 
Button intended for Account Screen's Opportunity Related ListThe above imiage shows a button which is intended for the Opportunity Related List on the Account screen. I have successfully place this button there. The problem is that when I click on the button the visualforce page defined on the standard New opportunity button still gets launched. 
Here is the overridden Stanard New Opportunity button.
Shows Standard Button is overriden with VF pageShows how Standard New button is defined with override VFSo, again, even though New2 button is on the related list, the "OpportunityCreate" visualforce page is still invoked. 
Hopefull this is clear., 
thanks
 
HI ,

I am facing the following error , can anyone please help me to resolve this error.
 
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Sales Order” 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.: []

My test cass is following here 
 
@isTEst
public class GD_SalesOrderPrintableViewTest {

    
    public static testmethod void testData(){
        
        Account acc = GD_TestDataFactory.createCustomer('Acc1','Customer');
        insert acc;
        
        GD_Address__c address = new GD_Address__c(GD_account__c = acc.id, GD_Address_1__c = 'address 1', GD_Address_2__c = 'address 2', GD_Address_3__c = 'address 3');
        insert address;
        
        GD_Order__c ord = new GD_Order__c(GD_Account__c = acc.id);
        insert ord;
        
        GD_Inventory_Organization__c inOrg = new GD_Inventory_Organization__c(Name = 'Test'); 
        insert inOrg;
        
        GD_Item_Master__c imas = new GD_Item_Master__c(GD_Item_Code__c= '001122', GD_Unit_Price__c = 1, GD_Inventory__c = inOrg.id);
        insert imas;
        
        GD_Order_Line_Item__c oli = new GD_Order_Line_Item__c(name = 'test',GD_Unit_Price__c = 10, GD_Quantity__c = 2,GD_Item__c = imas.id, GD_Vat__c = 2);
        oli.GD_Sales_Order__c = ord.id;
        insert oli;
        
        
        
        ApexPages.StandardController sc = new ApexPages.standardController(oli);
        GD_SalesOrderPrintableView controller = new GD_SalesOrderPrintableView(sc); 
        
    }
    
}

my class is following here 
 
/*
Description : Generate PDF in Sales order Details Page.
*/


public with sharing class GD_SalesOrderPrintableView {
    
    public string so_Id = apexpages.currentpage().getparameters().get('id');
    public List<GD_Order_Line_Item__c> accList{get;set;}
    public List<GD_Address__c> addList{get;set;}
    set<id> accId = New set<id>();
    public GD_SalesOrderPrintableView (ApexPages.StandardController controller){
        accList = [select id,name ,GD_Unit_Price__c,GD_Total_Amount_Formula__c, GD_Quantity__c,GD_Item__r.GD_Item_Code__c, GD_Vat__c, GD_Discount__c from GD_Order_Line_Item__c where GD_Sales_Order__c =: so_Id];
        GD_Order__c so = [select id,name,GD_Account__c from GD_Order__c where id =:so_Id]; 
        string acc = so.GD_Account__c;
        system.debug('Account Name ++ ' + acc);
        addList = [select id,name,GD_Type__c,GD_Account__c,GD_Address_1__c,GD_Address_2__c,GD_Address_3__c from GD_Address__c where GD_Account__c =:acc and  GD_Type__c = 'BILL_TO' Limit 1];
    }
}

Thanks in advance,
Regards,
Soundar.​​​​​​​
Hi everyone,
Hope everyone is safe and healthy...
I have a scenario where clients from community portal will go in and approve or reject there quotes. 
I got the page up and everything but updating the selected record i am having an issue with, especially the picklist value of the selected record.
Record 1 Status selected is Approved
Record 2 Status selected is Declined
They hit Save button
Both Records 1 & 2 will be saved with Declined.
Please Help
VisualForce Page
<apex:page controller="ZAttachmentViewer" showHeader="false" docType="html-5.0" lightningStylesheets="true">
<!--Outputpanel rendered in "acct" not equal to null-->
<!--<apex:outputPanel rendered="{!IF(account != null, true, false)}"> -->
<apex:form >
<apex:pageblock id="acct">

    <apex:pageblockTable value="{!acct}" var="ac">

        <apex:column value="{!ac.Quote_Status__c}" headerValue="Quote Status"/>
        
        <apex:column value="{!ac.Quote_Number__c}" headerValue="Quote Number"/>
        <apex:column value="{!ac.Id}" headerValue="Id"/>
        <apex:column value="{!ac.Status__c}" headerValue="Id"/>
        
        <apex:column headerValue="Approve or Reject here">
            <apex:selectList value="{!details}" size="1">
                <apex:selectOptions value="{!Items}" />
            </apex:selectList>        
        </apex:column>
        
        <apex:column headerValue="Comments">
            <apex:inputTextarea value="{!comments}" id="txtusername"/>     
        </apex:column>
        

        
        <apex:column headerValue="Approve/Reject Here">
            <apex:commandButton value="Approve/Reject " action="{!Submit}"/>  
        </apex:column>        

</apex:pageblockTable>
<apex:pageblockSection >
<apex:commandButton value="Approve/Reject " action="{!Submit}"/> 
</apex:pageblockSection>
                       
</apex:pageblock>

<apex:pageblock id="attachment" title="Attachments" >

    <apex:pageblockTable value="{!att}" var="a">
    
        <apex:column headerValue="Download">
            <apex:outputLink value="{!URLFOR($Action.Attachment.Download, a.Id)}" target="_blank">View</apex:outputLink>
        </apex:column>
        <apex:column value="{!a.Parent.Name}" headerValue="Quote Number"/>
        <apex:column value="{!a.Name}" headerValue="File Name"/>
        <apex:column value="{!a.LastModifiedDate}"/>  
   
   </apex:pageblockTable>
   
   
</apex:pageblock>   

</apex:form>
<!-- </apex:outputPanel>-->
</apex:page>
Apex Code:
public with sharing class ZAttachmentViewer{


    //private ApexPages.StandardController controller {get; set;}
    public List<Attachment> att{get;set;}
    public List<Community_Quote__c> acct{get;set;}  
    public List<Community_Quote__c> qqq = new List<Community_Quote__c>();
    public String StatusInput {get;set;}
    public String errorMessage { get; set; }
    public String details{get; set;}
    public String comments{get;set;}

    // standard controller - could also just use custom controller
    public ZAttachmentViewer(ApexPages.StandardController controller) {}

    public ZAttachmentViewer() {

        //Get UserId of the current user
        String usrid = UserInfo.getUserId();
        System.Debug('+++++++++UserID++++' + usrid);    
        
        //Run the Userid that we recieved and get the Account Id associated with it         
        User recordId = [SELECT AccountId__c FROM User Where ID=:usrid];
        System.Debug('+++++++++recordId++++' + recordId);
        
        account = recordId.AccountId__c;
        
        //Check to see if we get the Account ID
        System.Debug('+++++++++AccountId++++' + recordId.AccountId__c);
        
            
        //Use the AccountId into query to get results
        acct = [Select Id, Name,Account__c,Case__c,Quote_Status__c,
                Quote_Number__c,Comment__c, Status__c 
                from Community_Quote__c 
                where 
                Account__c=:recordId.AccountId__c 
                and 
                Quote_Status__c='Proposed to Client'];
        
        att = [select Id,ContentType,ParentId,Parent.Type,Parent.Name,OwnerId,Owner.Name, Name, LastModifiedDate, BodyLength from Attachment where ParentId = :acct];
        
        
    }
  
    public String options { get; set; }

     public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new selectOption('None', ' None '));
        options.add(new SelectOption('Accepted by Client','Accepted by Client'));
        options.add(new SelectOption('Rejected','Rejected'));
        return options;

    }
    

    public PageReference Submit() {
    
    List<Community_Quote__c> cpqlist = [select Id,Status__c,Comment__c,Quote__c from Community_Quote__c where Id=:acct];
        
        if(!cpqlist.isEmpty()) {
            for(Community_Quote__c ccc: accountIds){
                ccc.Status__c = details;
                ccc.Comment__c = comments;
                qqq.add(ccc);   

            }

        update qqq;
        }

    return null;
    }
}


 

I have Leads converting without the Notes & Attachments being moved over to the new Opportunity, Contact, and Account records. I can see the attachment remains on the Lead record when I query the Attachments object and look at the ParentId. Does anyone know if it's possible to move an attachment on a converted Lead to it's new Opportunity, Contact, and Account records? Or more importantly, why would this not be happening in the first place?

 

Some more information about what is happening:

We use a HelloSign integration. When a customer signs a pdf, it comes back to Salesforce as "Signature Complete" which triggers a process in Process Builder that fires an invocable method that converts the Lead. That pdf does not appear on the newly created Opportunity, Contact, or Account records. Yet it appears to be on the converted Lead record instead.

 

Any help would be greatly appreciated!

 

Here's the code for the auto conversion invocable method if it's helpful:

public without sharing class AutoConvertLeads {
    @InvocableMethod(label='Convert Pre-Qual Leads' description='Converts Leads with Pre-Qualification Signature Request | Keeps running user as the owner of new Opportunity, Contact, and Account | Updates converted Opportunity status to Application In' category='Lead')
    public static void convertLeads(List<Id> leadIds) {
        LeadStatus conLeadStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
        List<Database.LeadConvert> massLeadConvertList = new List<Database.LeadConvert>();
        Id currentUserId               = UserInfo.getUserId();
        String currentUserName         = UserInfo.getName();
        Set<Id> leadIdsSet             = new Set<Id>();
        Set<Id> convOppIds             = new Set<Id>();
        List<Opportunity> oppsToUpdate = new List<Opportunity>();
        String preQualTemplate         = '[V.2] Pre-Qualification'; // name of template to run the trigger
        System.debug('***** DEBUG FIRST | AutoConvertLeads | User Id who auto converted the Lead: ' + currentUserId + 
        ' and Name: ' + currentUserName);

        // Get only the leads that have '[V.2] Pre-Qualification' signature request template
        for (HelloSign__HelloSign_Signature_Request__c signRequest : [SELECT Id, HelloSign__Template__r.Name, HelloSign__Lead__c FROM HelloSign__HelloSign_Signature_Request__c WHERE HelloSign__Lead__c IN :leadIds]) {
            if (signRequest.HelloSign__Template__r.Name == preQualTemplate) {
                leadIdsSet.add(signRequest.HelloSign__Lead__c);
            }
        }

        // Begin Converting Leads
        if (!leadIds.isEmpty() && !leadIdsSet.isEmpty()) {
            for (Id currentlead : leadIdsSet) {
                    Database.LeadConvert leadConvert = new Database.LeadConvert();
                    leadConvert.setLeadId(currentlead);                
                    leadConvert.setConvertedStatus(conLeadStatus.MasterLabel);
                    leadConvert.setOwnerId(currentUserId);
                    massLeadConvertList.add(leadConvert);
            } // end leadIdsSet loop
            
            if (!massLeadConvertList.isEmpty()) {
                List<Database.LeadConvertResult> lcrs = Database.convertLead(massLeadConvertList);
                for (Database.LeadConvertResult lcr : lcrs) {
                    System.debug('***** DEBUG 2 | AutoConvertLeads | Was lead conversion successfull? ' + lcr.isSuccess());
                    convOppIds.add(lcr.getOpportunityId());
                }
                System.debug('***** DEBUG 3 | AutoConvertLeads | Is ConvOppIds set empty? ' + convOppIds.isEmpty());
                if (lcrs.get(0).isSuccess() && !convOppIds.isEmpty()) {
                    // change Opportunity stage to 'Application Sent'
                    List<Opportunity> convertedOpps = [
                        SELECT Id, StageName, OwnerId, Owner.Name
                          FROM Opportunity
                         WHERE StageName != 'Application In'
                           AND Id IN :convOppIds

                    ];
                    System.debug('***** DEBUG 4 | AutoConvertLeads | Is convertedOpps list empty? ' + convertedOpps.isEmpty());
                    if (!convertedOpps.isEmpty()) {
                        for (Opportunity convertedOpp : convertedOpps) {
                            convertedOpp.StageName = 'Application In';
                            System.debug('***** DEBUG 5 | AutoConvertLeads | Converted Opportunity Stage: ' + convertedOpp.StageName);
                            System.debug('***** DEBUG FINAL | AutoConvertLeads | Owner of Converted Opp: ' + convertedOpp.OwnerId);
                            oppsToUpdate.add(convertedOpp);
                        }
                        if (!oppsToUpdate.isEmpty()) {
                            update oppsToUpdate;
                        } // end oppsToUpdate null check
                    } // end convertedOpps null check
                } // end lcrs and convOppIds null check
            } // end massLeadConvertList null check       
        } // end leadIds null check
    } // end leadAssign method
} // end AutoConvertLeads class
When i do a click to dial, this error pops up. Sometime the callback is called, something it doesn't, but this error remains coming everytime.

I have mydomain activated.

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-42e597a4-667c-f6ba-2df2-fccd6d60abf0' chrome-extension: 'unsafe-inline' 'unsafe-eval' https://sfdc.azureedge.net *.na46.visual.force.com https://ssl.gstatic.com/accessibility/". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.

User-added image

Hope to get a help on this
We have recently developed a new community with lighting components on it. This community works perfect on all the browsers, but on IE 11 (11.0.90) it fails on the landing page component.(It only show standard loading screen)

When i opened it in community builder in IE it says:

Error ID: 1960994957

This page has an error. You might just need to refresh it. Failed to initialize a component [Expected ':'] Callback failed: serviceComponent://ui.comm.runtime.components.aura.components.siteforce.controller.PubliclyCacheableComponentLoaderController/ACTION$getPageComponent Failing descriptor: {siteforce-generatedpage-ce00a3fa-6452-4398-9cc2-0e630449a95f.c1550051805662}

Do anyone know whats going wrong?
Use Case 

We are trying to implement social single sign-on for community users. We donot want to create a new user in salesforce, this will only available only for existing community users.

We need user to authenticate using there Linkedin and then user should get a login screen to connect that Linkedin profile with it.
We know we can use registration handler, but what if the user email address in SF is different to his social email address?

One solution tried
We used salesforce existing user linking url generated by Sf https://CommunnityURL/services/auth/link/OrgID/LinkedIn
But this gives an error : We can’t log you in because of the following error. For more information, contact your Salesforce administrator. CSRF: No CSRF cookie
I am not sure whether this use case is possible or not.
Thank you.
While developing salesforce lightning component, we faced a weird issues. As you know till now we cannot directly use salesforce picklist field as a standard input field in LC, so as a workaround we have to create our own ui:selectlist
Now, while creating same, we added almost 500 picklist values in a single component for country and currency. This stops the component to load. It gives an error of "Event Fired".
Anyone faced something similar? We are using lightning components in Napili Template.
Hi Guys,

I am facing a starnge behaviour of inline VisaulForce on my deatil page of contact in Salesforce1.
I have 3 buttons on my visualforce(Nothing else on page), now i have added this visualforce on my contact page layout. This works fine when i run this on web browsers, but when i see it on my mobile device the page looks good but when i click on button the complete visaulforce page gets open again with only this 3 buttons on page and then i can click on those button which redirects me to some othe page.

Is it possible to make those button clickable same at inline visualforce itself(instead of opening same page again).

Below is code of the Page:
<apex:page docType="html-5.0" standardController="Contact" showHeader="false" sidebar="false" standardStylesheets="false">
<script>
function test1(){
    if ( (typeof window.sforce != 'undefined') && (window.sforce!=null) ) {
      sforce.one.navigateToURL('/apex/XXXXX?ConId={!Contact.Id}&retURL=/{!Contact.Id}');
    }
    else {
      alert('Not in SF1 :(');
    }
}
function test2(){

}
function test3(){

}   
</script>
                <apex:form >
                    <apex:commandButton styleClass="sf1button" value="Add" onclick="test1()" />
                    <apex:commandButton styleClass="sf1button" value="New" onclick="test2()"/>
                    <apex:commandButton styleClass="sf1button" onclick="test3()" value="View"/>
                </apex:form>
</apex:page>

Hi All,

 

 

I have scheduled a batch apex through a general piece of code to run it every Morning 6 o'clock :

 

scheduledMerge m = new scheduledMerge();
string sch = '0 0 6 * * ?';
system.schedule('Merge Job', sch, m);

 

Now this is working absolutely fine and running every morning at 6.

But when it comes to my All Scheduled Jobs Page under Monitoring, and i try to manage it from there it shows that the job is running on 1st of the Month. 

Not able to get why is this so.?

 

Please help me to figure this out.

 

 

 

 

Data storage is used 94% and out of that 55% is been used by email messages. I want to know that the emails that we sync with Salesforce, are they counted in tasks or email messages?

How can I query email messages for accounts?
When I try to create a custom tab, I am unable to and I get the following message: 
Validation Errors While Saving Record(s) 
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "This Developer Name already exists or has been previously used. Please choose a different name.". 
Click here to return to the previous page. 

In Tabs section of Setup there is no custom tab for this object. Also it cannot be found in profile settings or metadata. I tried SOQL query using tooling api, but I can't find the tab. The only place where it's mentioned is Rename Tabs and Labels in Setup, but that also doesn't do any help. The tab was certainly there before, but at some point it disappeared.

Has anyone had a similar issue? Any help would be greatly appreciated. Thanks!
Our standard 'New Opportunity' button is overriden to invoke a visualforce page. Can I create a different 'New Opportunity' button for use only on the Account screen's Opportunity Related List which does NOT invoke that invoke that same visualforce page. 
Button intended for Account Screen's Opportunity Related ListThe above imiage shows a button which is intended for the Opportunity Related List on the Account screen. I have successfully place this button there. The problem is that when I click on the button the visualforce page defined on the standard New opportunity button still gets launched. 
Here is the overridden Stanard New Opportunity button.
Shows Standard Button is overriden with VF pageShows how Standard New button is defined with override VFSo, again, even though New2 button is on the related list, the "OpportunityCreate" visualforce page is still invoked. 
Hopefull this is clear., 
thanks
 
HI ,

I am facing the following error , can anyone please help me to resolve this error.
 
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, We can't save this record because the “Sales Order” 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.: []

My test cass is following here 
 
@isTEst
public class GD_SalesOrderPrintableViewTest {

    
    public static testmethod void testData(){
        
        Account acc = GD_TestDataFactory.createCustomer('Acc1','Customer');
        insert acc;
        
        GD_Address__c address = new GD_Address__c(GD_account__c = acc.id, GD_Address_1__c = 'address 1', GD_Address_2__c = 'address 2', GD_Address_3__c = 'address 3');
        insert address;
        
        GD_Order__c ord = new GD_Order__c(GD_Account__c = acc.id);
        insert ord;
        
        GD_Inventory_Organization__c inOrg = new GD_Inventory_Organization__c(Name = 'Test'); 
        insert inOrg;
        
        GD_Item_Master__c imas = new GD_Item_Master__c(GD_Item_Code__c= '001122', GD_Unit_Price__c = 1, GD_Inventory__c = inOrg.id);
        insert imas;
        
        GD_Order_Line_Item__c oli = new GD_Order_Line_Item__c(name = 'test',GD_Unit_Price__c = 10, GD_Quantity__c = 2,GD_Item__c = imas.id, GD_Vat__c = 2);
        oli.GD_Sales_Order__c = ord.id;
        insert oli;
        
        
        
        ApexPages.StandardController sc = new ApexPages.standardController(oli);
        GD_SalesOrderPrintableView controller = new GD_SalesOrderPrintableView(sc); 
        
    }
    
}

my class is following here 
 
/*
Description : Generate PDF in Sales order Details Page.
*/


public with sharing class GD_SalesOrderPrintableView {
    
    public string so_Id = apexpages.currentpage().getparameters().get('id');
    public List<GD_Order_Line_Item__c> accList{get;set;}
    public List<GD_Address__c> addList{get;set;}
    set<id> accId = New set<id>();
    public GD_SalesOrderPrintableView (ApexPages.StandardController controller){
        accList = [select id,name ,GD_Unit_Price__c,GD_Total_Amount_Formula__c, GD_Quantity__c,GD_Item__r.GD_Item_Code__c, GD_Vat__c, GD_Discount__c from GD_Order_Line_Item__c where GD_Sales_Order__c =: so_Id];
        GD_Order__c so = [select id,name,GD_Account__c from GD_Order__c where id =:so_Id]; 
        string acc = so.GD_Account__c;
        system.debug('Account Name ++ ' + acc);
        addList = [select id,name,GD_Type__c,GD_Account__c,GD_Address_1__c,GD_Address_2__c,GD_Address_3__c from GD_Address__c where GD_Account__c =:acc and  GD_Type__c = 'BILL_TO' Limit 1];
    }
}

Thanks in advance,
Regards,
Soundar.​​​​​​​
User-added image
How to minimise two condtions in 1 line.
trigger Trigger1Problem on Account (after Insert, after Update)
{
    if(Trigger.isAfter)
    {
            if(Trigger.isInsert)
            {
                List<Opportunity>opp = new List<Opportunity>();
    
                Map<Id, Account>mapacc = new Map<Id, Account>
                ([Select Id, Name,(Select Id, Name From Opportunities) From Account Where Id In :trigger.new]);
    
            for(Account acc : trigger.new)
                {
                    if(mapacc.get(acc.Id).Opportunities.size() == 0)
                        {
                            opp.add(new Opportunity(AccountId =acc.Name, Name ='FirstOpportunity'+acc.Name, StageName = 'prospecting'
                            , CloseDate = System.today()));
                        }
                }
                insert opp;

            }
            else
            {
                if(Trigger.isUpdate)
                {
                    Map<Id, Account> nMap = new Map<Id, Account>();
                    
                    nMap = Trigger.newMap;
                    
                    List<Opportunity>opp = [Select Id, Name From Opportunity Where
                    Id In : nMap.keySet()];
                    
                    for(Opportunity oppup : opp)
                    {
                        Account a = nMap.get(oppup.Id);
                        
                        oppup.Name = a.Name;
                    }
                    update opp;
                }
            }
    
    }
    
}
no error but not inserted or not updated record doing this question 
1) context variable 
2) Helper class
A lot of Picklists in our Org are sorted in the order in which a give process is completed. Is there a way to use formulas based on the sort order of a given picklist. I know this meta-data is available because if you sort by a non-alphabetical sorted picklist in a list view, it gives results in the defined order of the picklist values. So is there any way in a Validation Rule for example where you can have it equal true if you go past some picklist value OR have yet to reach a picklist value without explicitly covering all pick values before or after the picklist value in question. I will give a brief example below.

I have a date field: Date_Field_c
I have a Picklist field: Picklist_Field_c 
which has values: "Stage 1", Stage 2", "Stage 3", "Stage 4", "Stage 5"
with Stage 1, being first and Stage 5 being last in the defined sort order. 

I want the date field to be populated for Stages 3, 4, and 5.

Instead of writing a formula like:
AND(ISBLANK(Date_Field_c),
    OR(
       ISPICKVAL(Picklist_Field_c,"Stage 3"),
       ISPICKVAL(Picklist_Field_c,"Stage 4"),
       ISPICKVAL(Picklist_Field_c,"Stage 5")
    )
)

OR a formula like: 
AND(ISBLANK(Date_Field_c),
       NOT(ISPICKVAL(Picklist_Field_c,"Stage 1")),
       NOT(ISPICKVAL(Picklist_Field_c,"Stage 2"))
)

I would prefer to write something like:
AND(ISBLANK(Date_Field_c),Picklist_Field_c>ISPICKVAL(Picklist_Field_c,"Stage 2")

We have a lot of picklists with a large number of values. Otherwise, this would not be a big deal to write the other 2 ways, but I can think of several use cases where something like I am looking for would be handy. I understand there be some additional requirement to define the record type since the sort order is defined at the record type level. But I could just add $RecordType.DeveloperName = "Record Type X" to account for that. 

I have Leads converting without the Notes & Attachments being moved over to the new Opportunity, Contact, and Account records. I can see the attachment remains on the Lead record when I query the Attachments object and look at the ParentId. Does anyone know if it's possible to move an attachment on a converted Lead to it's new Opportunity, Contact, and Account records? Or more importantly, why would this not be happening in the first place?

 

Some more information about what is happening:

We use a HelloSign integration. When a customer signs a pdf, it comes back to Salesforce as "Signature Complete" which triggers a process in Process Builder that fires an invocable method that converts the Lead. That pdf does not appear on the newly created Opportunity, Contact, or Account records. Yet it appears to be on the converted Lead record instead.

 

Any help would be greatly appreciated!

 

Here's the code for the auto conversion invocable method if it's helpful:

public without sharing class AutoConvertLeads {
    @InvocableMethod(label='Convert Pre-Qual Leads' description='Converts Leads with Pre-Qualification Signature Request | Keeps running user as the owner of new Opportunity, Contact, and Account | Updates converted Opportunity status to Application In' category='Lead')
    public static void convertLeads(List<Id> leadIds) {
        LeadStatus conLeadStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true Limit 1];
        List<Database.LeadConvert> massLeadConvertList = new List<Database.LeadConvert>();
        Id currentUserId               = UserInfo.getUserId();
        String currentUserName         = UserInfo.getName();
        Set<Id> leadIdsSet             = new Set<Id>();
        Set<Id> convOppIds             = new Set<Id>();
        List<Opportunity> oppsToUpdate = new List<Opportunity>();
        String preQualTemplate         = '[V.2] Pre-Qualification'; // name of template to run the trigger
        System.debug('***** DEBUG FIRST | AutoConvertLeads | User Id who auto converted the Lead: ' + currentUserId + 
        ' and Name: ' + currentUserName);

        // Get only the leads that have '[V.2] Pre-Qualification' signature request template
        for (HelloSign__HelloSign_Signature_Request__c signRequest : [SELECT Id, HelloSign__Template__r.Name, HelloSign__Lead__c FROM HelloSign__HelloSign_Signature_Request__c WHERE HelloSign__Lead__c IN :leadIds]) {
            if (signRequest.HelloSign__Template__r.Name == preQualTemplate) {
                leadIdsSet.add(signRequest.HelloSign__Lead__c);
            }
        }

        // Begin Converting Leads
        if (!leadIds.isEmpty() && !leadIdsSet.isEmpty()) {
            for (Id currentlead : leadIdsSet) {
                    Database.LeadConvert leadConvert = new Database.LeadConvert();
                    leadConvert.setLeadId(currentlead);                
                    leadConvert.setConvertedStatus(conLeadStatus.MasterLabel);
                    leadConvert.setOwnerId(currentUserId);
                    massLeadConvertList.add(leadConvert);
            } // end leadIdsSet loop
            
            if (!massLeadConvertList.isEmpty()) {
                List<Database.LeadConvertResult> lcrs = Database.convertLead(massLeadConvertList);
                for (Database.LeadConvertResult lcr : lcrs) {
                    System.debug('***** DEBUG 2 | AutoConvertLeads | Was lead conversion successfull? ' + lcr.isSuccess());
                    convOppIds.add(lcr.getOpportunityId());
                }
                System.debug('***** DEBUG 3 | AutoConvertLeads | Is ConvOppIds set empty? ' + convOppIds.isEmpty());
                if (lcrs.get(0).isSuccess() && !convOppIds.isEmpty()) {
                    // change Opportunity stage to 'Application Sent'
                    List<Opportunity> convertedOpps = [
                        SELECT Id, StageName, OwnerId, Owner.Name
                          FROM Opportunity
                         WHERE StageName != 'Application In'
                           AND Id IN :convOppIds

                    ];
                    System.debug('***** DEBUG 4 | AutoConvertLeads | Is convertedOpps list empty? ' + convertedOpps.isEmpty());
                    if (!convertedOpps.isEmpty()) {
                        for (Opportunity convertedOpp : convertedOpps) {
                            convertedOpp.StageName = 'Application In';
                            System.debug('***** DEBUG 5 | AutoConvertLeads | Converted Opportunity Stage: ' + convertedOpp.StageName);
                            System.debug('***** DEBUG FINAL | AutoConvertLeads | Owner of Converted Opp: ' + convertedOpp.OwnerId);
                            oppsToUpdate.add(convertedOpp);
                        }
                        if (!oppsToUpdate.isEmpty()) {
                            update oppsToUpdate;
                        } // end oppsToUpdate null check
                    } // end convertedOpps null check
                } // end lcrs and convOppIds null check
            } // end massLeadConvertList null check       
        } // end leadIds null check
    } // end leadAssign method
} // end AutoConvertLeads class

We have a main form on website pages where we have basic SFDC code styled with CSS. We have added campaign ID, webpage URL etc and it works fine.  

We also have popout buttons on the side to Contact Us, Request a Quote or Request Service.  Each of those buttons opens a form with the exact same code (styled differently) as the main form, but each popout form is given a unique name so that the Submit command knows what form to use.  When we are in debug, we see the correct submission from each button (form), but these leads never get to SFDC.  
A submit input example from a popout form is :
<input type="submit" name="submit" value="Send" form="ContactWebToLeadForm">

Where ContactWebToLeadForm is one of the popout forms.

Can anyone see where we might have an issue with our logic?  

Alternatively, does anyone have a suggestion for alternate means to support several forms on one html page?

Thank you in advance

How can I auto populate a commission rate field in a Purchase Order custom Object from another custom object where we have saved specific rates for different customers? I would like to be able to enter the customer's name when creating a new Purchase Order record and then have the comm rate field in the Purchase Order object get pulled from the rates table.    
We want to have 2 separate communities which are able to send messages to each other in a 1-on-1 conversation.

Community A users will be able to initialise a conversation and respond to threads they have opened.
Community B users will be able to send messages in threads which have been opened with that user.

For example:
Community A user opens a conversation with Community B user

Community B user responds.

Community A user responds again.

Can you please let me know what would be required for this project?
My most major concern is Community B users should not be able to see other users in Community A or B. They should only be able to see the name of the Community A user that opened a thread with them.

I have been researching for threads in google regarding this but  I have not found any threads regarding the same.
  • March 23, 2020
  • Like
  • 0
Hi ,

I was in the middle of setting up my B2B storefront in developer org and once i reached the step where i have to create a new cache configuration i clicked on the "Build New" button
but even after couple of mins it showed nothing, I reapeated the steps couple of time but nothing happened . So i refreshed the page and after that when I am trying to load CC Admin tab
I am getting the following error.

Insert failed. First exception on row 0; firstUser-added image error: STORAGE_LIMIT_EXCEEDED, storage limit exceeded: []
Error is in expression '{!initDownload}' in component <apex:page> in page ccrz:cc_admin_admin: (System Code)


An unexpected error has occurred. Your solution provider has been notified. (ccrz)  


(attached is the screenshot for same)


I have just loaded the OTB (Demo coffee data) and thats just it and I don't have anything to delete from recycle bin as well


Could anyone help me with it ?


Thanks

Hello,

I want to integrate Salesforce with Asterisk PBX but i am having a hard time finding what system should i use for this, because all the posts i have seen are like 9 years old.

First of all i need that this integration works in South America.
Secondly i would need that this integration requires the least configuration from Asterisk PBX.

Suggestions are welcome
Thank you for your answers

Best regards
Rodrigo
 

We have recently developed a new community with lighting components on it. This community works perfect on all the browsers, but on IE 11 (11.0.90) it fails on the landing page component.(It only show standard loading screen)

When i opened it in community builder in IE it says:

Error ID: 1960994957

This page has an error. You might just need to refresh it. Failed to initialize a component [Expected ':'] Callback failed: serviceComponent://ui.comm.runtime.components.aura.components.siteforce.controller.PubliclyCacheableComponentLoaderController/ACTION$getPageComponent Failing descriptor: {siteforce-generatedpage-ce00a3fa-6452-4398-9cc2-0e630449a95f.c1550051805662}

Do anyone know whats going wrong?