• AArza
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I have created an onclick event on the cancel button in my visualforce page and it works as expected. I want to change the wording for OK and Cancel button to Yes, Proceed and No, Stay.
Is it possible. if yes, can someone suggest me how or share sample code
 
<apex:commandButton value="{!$Label.Cancel}" action="{!Cancel}" onclick="return confirm('{!$Label.Proceed_with_Cancellation}');" styleclass="slds-button slds-button_brand" style="width:150px;"/>

User-added image
 
  • September 11, 2019
  • Like
  • 0
Error: Method does not exist or incorrect signature: void replace(String, Datetime) from the type String

also, i noticed that even when i comment out the this line of code it is still returning the same error. please suggest.
 
for(ContentDocumentLink clIterator : trigger.new) {
        string strObjPrefix = String.valueOf(clIterator.LinkedEntityId).substring(0, 3);
        if(strObjPrefix == Appointment__c.sObjectType.getDescribe().getKeyPrefix()) {
            setCntDocIds.add(clIterator.ContentDocumentId);
            setAccIds.add(clIterator.LinkedEntityId);
            //Id str =setAccIds[0];
            Set<Id> str = new set<Id>(setAccIds);
            Appointment__c app= [select id from Appointment__c where id =:str limit 1] ;
			 
            system.debug('Email Body');//debug appointment
            string filename =filestitlemaps.get(clIterator.ContentDocumentId); 
            string accountname = accnamemaps.get(clIterator.LinkedEntityId);
            Set<String> KeywordSet = new Set<String>();
            
            
            
            Program_Setting__mdt[] programs = [SELECT Email_Body__c, Keyword__c, Keyword1__c FROM Program_Setting__mdt];        
            //if(filename.containsAny(programs[0].Keyword__c)){
            if((programs[0].keyword__c).containsAny(Filename)){
                
              Contact c = [Select id, name from contact where name='Ultragenyx PV'];
           //  List<string> toAddress = new List<string>();
            // toAddress.add('iamaarza@gmail.com');
             
 

                          
            EmailTemplate emailTemplate = [select Id, Subject, HtmlValue, Body from EmailTemplate where Id ='00X0i000000PGf1']; 
                String subject = emailTemplate.Subject;
                               //query appointment record pass values to replace the merge fields
        
            String plainBody = emailTemplate.Body;
            plainBody = plainBody.replace('{!app.Name}', app.Name);
            string s = string.valueOfGmt(app.Appointment_Start_Date__c);
            //plainBody = plainBody.replace('{!app.Appointment_Start_Date__c}', app.Appointment_Start_Date__c); 
            plainBody = plainBody.replace('{!app.Appointment_Start_Date__c}', s); 
                
           
      
              Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    mail.setTemplateId('00X0i000000PGf1');
                   // mail.setToAddresses(toAddress);
                    //mail.setSubject('test subject');
                    mail.setTargetObjectId(c.Id);
                    //mail.setWhatId(c.Id);
                    mail.setSaveAsActivity(false);
                    mail.setUseSignature(false);
                    
                    
                    List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>();
                    allmsg.add(mail); 
                     
        }
        
    }
}
}

 
  • August 26, 2019
  • Like
  • 0
I have created an onclick event on the cancel button in my visualforce page and it works as expected. I want to change the wording for OK and Cancel button to Yes, Proceed and No, Stay.
Is it possible. if yes, can someone suggest me how or share sample code
 
<apex:commandButton value="{!$Label.Cancel}" action="{!Cancel}" onclick="return confirm('{!$Label.Proceed_with_Cancellation}');" styleclass="slds-button slds-button_brand" style="width:150px;"/>

User-added image
 
  • September 11, 2019
  • Like
  • 0
Error: Method does not exist or incorrect signature: void replace(String, Datetime) from the type String

also, i noticed that even when i comment out the this line of code it is still returning the same error. please suggest.
 
for(ContentDocumentLink clIterator : trigger.new) {
        string strObjPrefix = String.valueOf(clIterator.LinkedEntityId).substring(0, 3);
        if(strObjPrefix == Appointment__c.sObjectType.getDescribe().getKeyPrefix()) {
            setCntDocIds.add(clIterator.ContentDocumentId);
            setAccIds.add(clIterator.LinkedEntityId);
            //Id str =setAccIds[0];
            Set<Id> str = new set<Id>(setAccIds);
            Appointment__c app= [select id from Appointment__c where id =:str limit 1] ;
			 
            system.debug('Email Body');//debug appointment
            string filename =filestitlemaps.get(clIterator.ContentDocumentId); 
            string accountname = accnamemaps.get(clIterator.LinkedEntityId);
            Set<String> KeywordSet = new Set<String>();
            
            
            
            Program_Setting__mdt[] programs = [SELECT Email_Body__c, Keyword__c, Keyword1__c FROM Program_Setting__mdt];        
            //if(filename.containsAny(programs[0].Keyword__c)){
            if((programs[0].keyword__c).containsAny(Filename)){
                
              Contact c = [Select id, name from contact where name='Ultragenyx PV'];
           //  List<string> toAddress = new List<string>();
            // toAddress.add('iamaarza@gmail.com');
             
 

                          
            EmailTemplate emailTemplate = [select Id, Subject, HtmlValue, Body from EmailTemplate where Id ='00X0i000000PGf1']; 
                String subject = emailTemplate.Subject;
                               //query appointment record pass values to replace the merge fields
        
            String plainBody = emailTemplate.Body;
            plainBody = plainBody.replace('{!app.Name}', app.Name);
            string s = string.valueOfGmt(app.Appointment_Start_Date__c);
            //plainBody = plainBody.replace('{!app.Appointment_Start_Date__c}', app.Appointment_Start_Date__c); 
            plainBody = plainBody.replace('{!app.Appointment_Start_Date__c}', s); 
                
           
      
              Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                    mail.setTemplateId('00X0i000000PGf1');
                   // mail.setToAddresses(toAddress);
                    //mail.setSubject('test subject');
                    mail.setTargetObjectId(c.Id);
                    //mail.setWhatId(c.Id);
                    mail.setSaveAsActivity(false);
                    mail.setUseSignature(false);
                    
                    
                    List<Messaging.SingleEmailMessage> allmsg = new List<Messaging.SingleEmailMessage>();
                    allmsg.add(mail); 
                     
        }
        
    }
}
}

 
  • August 26, 2019
  • Like
  • 0