• Saroja Murugan
  • NEWBIE
  • 90 Points
  • Member since 2017

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 49
    Replies
Hi,
I the below code, insertlstTarget is having duplicate values. How do i elminate them?
For(Course__c course1 : lstTarget){
                Course__c course2 = new Course__c ();
                course2 = course1.clone(false,false,false,false);
                course2.Specialisation_Code__c = '';
                course2.Specialisation__c = '';
                course2.Course_Code__c = course1.Name;
                newLstTarget.add(course2);
                system.debug('newLstTarget' + newLstTarget.size());
            }
            Map<String,Course__c> extIdMap1 = new Map<String,Course__c>();
            for(Course__c so1 : newLstTarget){
                extIdMap1.put((String)so1.get('Course_Code__c'),so1);
            }
            Set<String> extIdSet1 = extIdMap1.keyset();
            String splitQuery1 = 'SELECT Id,Course_Code__c FROM Course__c WHERE Course_Code__c in :extIdSet1';
            system.debug(splitQuery1);
            List<Course__c> insertlstTarget = new List<Course__c>();
            Map<Id,Course__c> updateMap1 = new Map<Id,Course__c>();
            Map<String,Id> queryMap1 = new Map<String,Id>();
            for(Course__c so1 : database.query(splitquery1)){
                queryMap1.put((String)so1.get('Course_Code__c'), so1.Id);
            }
            for(Course__c so1 : newLstTarget){
                Id theId = queryMap1.get((String)so1.get('Course_Code__c'));
                if(theId != null){
                    so1.Id = theId;
                    updateMap1.put(theId,so1);
                }
                else{
                    insertlstTarget.add(so1);
                }
            }

Thanks
How to use & symbol in validation rule error message, please help, trie with %26 its not working 
Thanks
Hi All,

In the below trail i received the error.

Admin Beginner-> Lightning Experience Customization-> Create Custom Buttons and Links 

Error Message
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: MIBJCQNW

Thanks in advance
Hi All,

When im tryin to run my visual force code its shows the below error.

User-added image
Can anyone guide how to solve this problem?

Thanks,
Saroja
Sweet Potato Tec
 
Hi all,
Now I’m using conga composer, when I try to access the workflow its shows the below error.

 User-added image

 
Can anyone advice me to how to solve this error?
Thanks ,
Sarav
 
 
 
 
 
 
Hi All,

Hope everybody doing well,

I have studied about enum datatype and trying to understand it by using the below code.

But it throw me an error while saving the apex class MyExample.

Please let me know how to resolve this?

Season:
public enum Season {
WINTER,SPRING,SUMMER,FALL
}

Month:
public enum Month {
JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC
}

MyExample:

public class MyExample {
public List seasonMonths(Season s)
{
List listMonths = new List();
if(s==season.WINTER)
{
listMonths.add(Month.DEC);
listMonths.add(Month.JAN);
listMonths.add(Month.FEB);
}
else if(s==season.SPRING)
{
listMonths.add(Month.MAR);
listMonths.add(Month.APR);
listMonths.add(Month.MAY);
}
else if(s==season.SUMMER)
{
listMonths.add(Month.JUN);
listMonths.add(Month.JUL);
listMonths.add(Month.AUG);
}
else if(s==season.FALL)
{
listMonths.add(Month.SEP);
listMonths.add(Month.OCT);
listMonths.add(Month.NOV);
}
return listMonths;
}
}

Thanks,
Hi,

We have  and automated code for updating the page layout through Apex Metadata API for example in like in below link.
https://trailhead.salesforce.com/modules/apex_metadata_api/units/apex_metadata_api_updates

Can we have some similar code for enabling the field history tracking of some fields.

Thanks
 
Hello,

I know there has to be a better way to make this table than the way I am currently doing it. Can anyone help me align all of my checkboxes and titles?

User-added image

Below is the code I am currently running. Each row is its own table, stacked on top of each other. I've attempted to mess with the width of the columns to try and make it as close as possible but it's just not working
 
<apex:page standardController="Correspondence__c" renderAs="pdf" >
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
            <style type="text/css">
                body {
                font-family: sans-serif;
                font-size:12px;
                }
            </style>      
        </head>    
        <body>   
            <table cellpadding="6" width="100%">
                <tr>
                    <td>
                        <apex:outputPanel >
                            <apex:image url="/servlet/servlet.FileDownload?file=0151D0000005bAO" width="150" Height="75"/>
                        </apex:outputPanel>
                    </td>
                    <td>
                        <apex:outputPanel >
                            Case Information
                        </apex:outputPanel>
                    </td>
                    <td>
                        <apex:outputPanel >
                            Form 2067
                        </apex:outputPanel>
                    </td>    
                </tr>
            </table>  

 <table cellpadding="6" width="70%">
                <tr>
                    <td style="vertical-align: text-top;">
                            To:
				    </td><td>
                        <div class="mybox">
        		<apex:outputField value="{!Correspondence__c.Payer_Name__c}"/><br/>
                <apex:outputField value="{!Correspondence__c.Payer_Fax_Number__c}"/><br/>
										
						</div>
                    </td>
                    <td style="vertical-align: text-top;">                      
                            From:
			       </td><td>
                        <div class="mybox">       			
                Outreach Health Services<br/>
        		251 W Renner Rd, <br/>
        		Richardson, TX 75080 
						</div>
                    </td>
                </tr>
            </table>       
             <table style="width:100%" border="1">


          <tr>
            <td>Case Name
                <br></br>
            <apex:outputField Value="{!Correspondence__c.Case_Name__c}" />
            </td>

            <td>Category <br></br> PERS</td>
            <td>Case No. <br></br> <apex:outputField Value="{!Correspondence__c.Case_No__c}"/></td>
            <td>Category<br></br> &nbsp;  </td>
            <td>Case No.<br></br> &nbsp;  </td>
          </tr>
          <tr width = "100%">
            <td width = "32%"></td>
            <td width = "11%"></td>
            <td width = "11%"> </td>
            <td width = "11%"></td>
            <td width = "15%">
            </td>
          </tr>         

        </table>        
        <table style="width:100%" border="1">


          <tr>

            <td>Address(Street, City, State, ZIP Code)
                <br></br>
            <apex:outputField Value="{!Correspondence__c.Patient_Address__c}"/>
              </td>
            <td>Area Code and Telephone No.
                <br></br>
    <apex:outputField Value="{!Correspondence__c.Payer_Fax_Number__c}"/>   
				</td>
                
            
          </tr>
          <tr width = "100%">
            <td width = "60%"></td>
            <td width = "40%"></td>
          </tr>         

        </table>        
   <b>Please Check all that apply.</b>  
<br></br>
<br></br>
             <table style="width:100%">


          <tr>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td> Absent Parent</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Change in Address/Telephone</td>  
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Change in Circumstances </td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Child Care</td>  
			<td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Community Placement Resources</td>
          </tr>      
          <tr width = "100%">
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
          </tr> 
        </table> 
             <table style="width:100%">
                 
          <tr>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td> Deductions</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Employment Services</td>  
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>EPSDT </td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Family Health Services Name</td>  
			<td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Family Planning</td>
          </tr>       
          <tr width = "100%">
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
          </tr>
        </table> 

             <table style="width:100%">
                 
          <tr>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td> Household Composition</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Income</td>  
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>LTSS Information Shared </td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Medicaid</td>  
			<td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Medical/Disability</td>
          </tr>       
          <tr width = "100%">
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
          </tr>
        </table> 
             <table style="width:100%">
                 
          <tr>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td> MERP Shared</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Nursing Care/Level of Care</td>  
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Protective Services</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Refugee Services</td>  
			<td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Resources</td>
          </tr>       
          <tr width = "100%">
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
            <td width = "5%"></td>
            <td width = "15%"></td>
          </tr>
        </table>
             <table style="width:100%">
                 
          <tr>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td> MERP Shared</td>
            <td><apex:outputField Value="{!Correspondence__c.VF_Checkbox__c}"/></td>
            <td>Nursing Care/Level of Care</td>  
            <td><apex:outputField Value="{!Correspondence__c.Other__c}"/></td>
            <td>Other</td>
            <td><apex:outputField Value="{!Correspondence__c.Reason_for_Form__c}"/></td>
          </tr>       
          <tr width = "100%">
            <td width = "4%"></td>
            <td width = "14%"></td>
            <td width = "5%"></td>
            <td width = "14%"></td>
            <td width = "5%"></td>
            <td width = "5%"></td>
            <td width = "60%"></td>
          </tr>
        </table>
        </body>
    </html>
</apex:page>

And here is a picture of the document that I am trying to remake with visual force 

User-added image
what is cross object formula field in salesforce
Hi,
I the below code, insertlstTarget is having duplicate values. How do i elminate them?
For(Course__c course1 : lstTarget){
                Course__c course2 = new Course__c ();
                course2 = course1.clone(false,false,false,false);
                course2.Specialisation_Code__c = '';
                course2.Specialisation__c = '';
                course2.Course_Code__c = course1.Name;
                newLstTarget.add(course2);
                system.debug('newLstTarget' + newLstTarget.size());
            }
            Map<String,Course__c> extIdMap1 = new Map<String,Course__c>();
            for(Course__c so1 : newLstTarget){
                extIdMap1.put((String)so1.get('Course_Code__c'),so1);
            }
            Set<String> extIdSet1 = extIdMap1.keyset();
            String splitQuery1 = 'SELECT Id,Course_Code__c FROM Course__c WHERE Course_Code__c in :extIdSet1';
            system.debug(splitQuery1);
            List<Course__c> insertlstTarget = new List<Course__c>();
            Map<Id,Course__c> updateMap1 = new Map<Id,Course__c>();
            Map<String,Id> queryMap1 = new Map<String,Id>();
            for(Course__c so1 : database.query(splitquery1)){
                queryMap1.put((String)so1.get('Course_Code__c'), so1.Id);
            }
            for(Course__c so1 : newLstTarget){
                Id theId = queryMap1.get((String)so1.get('Course_Code__c'));
                if(theId != null){
                    so1.Id = theId;
                    updateMap1.put(theId,so1);
                }
                else{
                    insertlstTarget.add(so1);
                }
            }

Thanks
Hi,

I have a requirement where i have to select the contact, once we save the opportunity record, it should throw error message if phone and email field are blank at contact record.

I am putting the below validtion rule, but it is not working.
AND(ISNULL( Key_Contact__r.Email ) , OR( ISNULL(  Key_Contact__r.Phone  ) , ISNULL( Key_Contact__r.OtherPhone ) ) )
Hi Team,

I have created custom detail page using visualforce pages, How to clone the record using Visualforce pages ?

Thanks,
Lakshmi.
Hello all,

Is there a way to make an export of Custom Labels for mass Update, and then Import them ?

Thanks in advance,
Hi,

I have two visualforce pages and 1 vf page iam showing filter page and on click on show table button. Dispaly of table need to display in another vf page
Hi,
The fields ACCOUNT_BILLINGLATITUDE and ACCOUNT_BILLINGLONGITUDE are not automatically filled when i create an account.
The Google Map find location.
How could i automatically update these 2 fields?

Thanks
Could Someone please explain me the power of one? I read many documentations and even trail but can't get it.
Hi i am digging into campaign object of sales cloud. 
I am not getting how fields like Leads in Campaign, Converted Leads in Campaign, Contacts in Campaign are calculated and auto populated on specific action

Please help on this!! Thanks!!
  • April 10, 2018
  • Like
  • 0
Does anyone know how to convert the below Apex to be for Person Accounts instead of Contacts?

trigger TriggertoCreateContactformCase on Case (before insert) {
    List<String> UseremailAddresses = new List<String>();
    //First exclude any cases where the contact is set
    for (Case c:Trigger.new) {
        if (c.ContactId==null &&
            c.SuppliedEmail!=''|| c.SuppliedEmail==null)
        {
            UseremailAddresses.add(c.SuppliedEmail);
        }
    }

    //Now we have a nice list of all the email addresses.  Let's query on it and see how many contacts already exist.
    List<Contact> listofallContacts = [Select Id,Email From Contact Where Email in:UseremailAddresses];
    Set<String> ExstingEmails = new Set<String>();
    for (Contact c:listofallContacts) {
        ExstingEmails.add(c.Email);
    }
    
    Map<String,Contact> emailToContactMap = new Map<String,Contact>();
    List<Case> casesToUpdate = new List<Case>();

    for (Case c:Trigger.new) {
        if (c.ContactId==null &&
            c.SuppliedName!=null &&
            c.SuppliedEmail!=null &&
            c.SuppliedName!='' &&
           !c.SuppliedName.contains('@') &&
            c.SuppliedEmail!='' &&
           !ExstingEmails.contains(c.SuppliedEmail))
        {
            //The case was created with a null contact
            //Let's make a contact for it
            String[] Emailheader = c.SuppliedName.split(' ',2);
            if (Emailheader.size() == 2)
            {
                Contact conts = new Contact(FirstName=Emailheader[0],
                                            LastName=Emailheader[1],
                                            Email=c.SuppliedEmail
                                            );
                emailToContactMap.put(c.SuppliedEmail,conts);
                casesToUpdate.add(c);
            }
        }
    }
    
    List<Contact> newContacts = emailToContactMap.values();
    insert newContacts;
    
    for (Case c:casesToUpdate) {
        Contact newContact = emailToContactMap.get(c.SuppliedEmail);
        
        c.ContactId = newContact.Id;
    }
}