• kirubakaran viswanathan
  • NEWBIE
  • 155 Points
  • Member since 2015

  • Chatter
    Feed
  • 4
    Best Answers
  • 1
    Likes Received
  • 3
    Likes Given
  • 11
    Questions
  • 41
    Replies
I have the start and end DateTime field in Opportunity, I need to split that into date and time based on customers' country in the record.

Eg: UTC : 2021-04-26T09:00:00.000+0000

Country is UK
Output:
Date : 26-04-2021
Time : 10 AM

If the country is Germany
Output:
Date : 26-04-2021
Time : 11 AM
 
I need to override the list of recordtypes displaying in the selection panel when the user clicks the "New" button.
Ex: I have recordtype A, B, C in Opportunity, whenever the user clicks "New" the selection window need to display only A and B. But he should have access to C recordtype. Because I have another quick action button in the detail page to create records with C recordtype for the user. 
Is that possible to override the selection window to display specific record type?
For example, I have a text " Hello World", I need to use this text in the places in the VF page based on the Output render conditions at least 4-5 times in a page. I don't want to repeat this text hardcoded in the multiple places.

How can we achieve this without any extension/custom controller? Because in future I may need to change the text in Prod directly, rather than pushing the changes through Changeset.

P.S: I have really long text and I have multiple texts like this to be repeated.
I need to display the email id with link based on program name in a para. How can I acheive in VF?
<p class = "doc-preview__copy txindent">
               If you have any questions regarding your next steps, please contact the {!TargetX_SRMb__Application__c.Program_Name__c} 
               admissions team  
                <apex:outputText value="{!IF(app.Program_Name__c == "abc", <a href="mailto:abc@abc.com">abc@abc.com</a>.,a href="mailto:123@abc.com">123@abc.com</a>
                                        ')}" />
   </p>
I am getting syntax error or EL Expression unbalanced error.


 
Hi,
I need to read the email template content alone into the VF page, is that possible?
 
I tried to convert the lead through batch processing, which need to update the existing contact based on the contact id. But the value in the contact record is not overwritten with the Lead value.
Can anyone help on this? Even I set the setOverwriteLeadSource(true); 
for(Lead record: scope) {
            Database.LeadConvert lc = new Database.LeadConvert();
            lc.setLeadId(record.Id);
            lc.setConvertedStatus(convertedStatus);
            
            if(matchAcct.containsKey(record.company))
            {
                lc.setAccountID(matchAcct.get(record.company).id);
            }
            if(matchCont.containsKey(record.Email))
            {
                lc.setContactID(matchCont.get(record.Email).id);
            }
            
            lc.setDoNotCreateOpportunity(true);
            lc.setOverwriteLeadSource(true);
            converts.add(lc);
        }
        
        system.debug('ConvertsLeads:' +converts);
       // Database.LeadConvertResult lcr ;
       List<Database.LeadConvertResult> lcr = Database.convertLead(converts,false);

 
Apex trigger casetriger caused an unexpected exception, contact your administrator: casetriger: execution of BeforeUpdate caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.casetriger: line 63, column 1
  1. trigger oppTr on Opportunity (after update,after insert){
  2.         
  3.     Map<Id,Opportunity> OppStage = new Map<Id,Opportunity>();
  4.     List<Account> AccList = new List<Account>();
  5.     
  6.     for(Opportunity opp : trigger.new){        
  7.         if(opp.StageName == 'Closed Lost' && trigger.oldMap.get(opp.Id).StageName == 'Closed Won'){
  8.            OppStage.put(opp.AccountId, opp);
  9.         }
  10.     }
  11.     System.debug('OppStage'+OppStage);
  12.    try {            
  13.    if(OppStage.size()>0){
  14.        System.debug('OppStage'+OppStage.size());
  15.         for(Opportunity opp2 : OppStage.values()){
  16.            System.debug('opp2'+opp2);
  17.            Account acc = new Account();
  18.            acc.Id = opp2.AccountId;
  19.            acc.Status__c = 'Lost';
  20.            AccList.add(acc);
  21.            System.debug('AccList'+acc.Status__c);
  22.         } 
  23.        update AccList;
  24.        System.debug('AccList'+AccList);
  25.     } 
  26.    } catch (System.NullPointerException e){
  27.      String s;
  28.         s.toLowerCase();
  29.    }   
  30.  
  31. }
instead error 
i must update the new values to old record with same name help me



trigger accounttrigger on Account (before insert, before update) {

     Map<String, Id> mapAccount = new Map<String, Id>();
    
    Set<String> setAccName = new Set<String>();
    for(Account acc : trigger.new)
        setAccName.add(acc.Name);
        
    for(Account acc : [ SELECT Id, Name FROM   Account WHERE  Name IN :setAccName ] )
        mapAccount.put(acc.Name, acc.Id);
    
    for(Account acc : trigger.new)
        if(mapAccount.containsKey(acc.Name) && mapAccount.get(acc.Name) != acc.Id)
            acc.addError( 'There is already another Account with the same Name. '  +  
                mapAccount.get(acc.Name) + '\'>' + acc.Name + '</a>', FALSE );
}
Just last week I started getting issues with picklists that have restricted values.  I am creating records in a test and I have copied the value right from the picklist when I recreate it in my test.. however, the test is failing due to, "System.DmlException: Insert failed. First exception on row 1; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Inter-Plan Preparing: [Cede_Status__c]"

I'm hoping there is just something I'm missing here?  

thanks!!

Fred
When we create an opportunity we create a certain number of quotes (custom, child record). I would like to be able to send an email to include information from all the quotes created under the opportunity.This is my first visualforce email template. I want to be able to pull I need some help because when I go to save I receive the following error: Unknown property 'core.email.template.EmailTemplateController.Opportunity'
 
<messaging:emailTemplate recipientType="User"
                     relatedToType="Opportunity"
                     subject=" {!Opportunity.Account}, {!Quotes_RFR__c.Current_Carrier__c}, {!Opportunity.Date_Due__c},{!Opportunity.Total_Eligible__c}" >
<messaging:htmlEmailBody >  
    <html>
        <body>
            <STYLE type="text/css">
                TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center } 
                TD  {font-size: 11px; font-face: verdana } 
                TABLE {border: solid #CCCCCC; border-width: 1}
                TR {border: solid #CCCCCC; border-width: 1}
            </STYLE>
            <font face="arial" size="2">
                <table border="0" >
                    <tr > 
                        <th>Quote Number</th><th>Contribution Type</th><th>In Network</th><th>Out of Network</th>
                    </tr>
                    <apex:repeat var="cx" value="{!Quotes_RFR__c}">
                        <tr>
                            <td>{!Quotes_RFR__c.Quote_Name__c} </td>
                            <td>{!Quotes_RFR__c.Contribution_Type__c}</td>
                            <td>{!Quotes_RFR__c.In_NetworkDiag_Prev__c}/ {!NullValue(Quotes_RFR__c.In_Network_Basic__c, "0")}/ {!NullValue(Quotes_RFR__c.In_Network_Major__c, "0")}/ {!NullValue(Quotes_RFR__c.In_Network_Ortho__c, "0")}; {!Quotes_RFR__c.In_Network_Deductible_Ind__c}/ {!Quotes_RFR__c.In_Network_Deductible_Fam__c} Ded; {!Quotes_RFR__c.In_Network_Annual_Max__c} Max; {!NullValue(Quotes_RFR__c.In_Network_Ortho_Max__c, "0")}</td>
                            <td>{!Quotes_RFR__c.Out_Network_Diag_Prev__c}/ {!NullValue(Quotes_RFR__c.Out_Network_Basic__c, "0")}/ {!NullValue(Quotes_RFR__c.Out_Network_Major__c, "0")}/ {!NullValue(Quotes_RFR__c.Out_Network_Ortho__c, "0")}; {!Quotes_RFR__c.Out_Network_Deductible_Ind__c}/ {!Quotes_RFR__c.Out_Network_Deductible_Fam__c} Ded; {!Quotes_RFR__c.Out_Network_Annual_Max__c} Max; {!NullValue(Quotes_RFR__c.Out_Network_Ortho_Max__c, "0")} </td>
                        </tr>
                    </apex:repeat>                 
                </table>
                <p />
            </font>
        </body>
    </html>
</messaging:htmlEmailBody> 
</messaging:emailTemplate >