• VICKY_SFDC
  • NEWBIE
  • 20 Points
  • Member since 2019


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 11
    Replies
The condition for my trigger is every wednessday at 6 pm get all the records from campaign object and based on the value of a field and call status from its related call history object... then send an email to those campaign members
Assume In an account opportunity is there then 2nd opportunity its pop up an An error else if no opportunity is there then automatic an opportunity will be created?
Whenever m insert a contact or  list of contact, same email and phone number popup an error of duplicate error
       Based on contact email and phone?
 
Account  picklist filed status__c changes to completed , when all fields are  not empty else status__c show as incomplete,,
If status__c changes to completed
,i want checkbox in all the related contact should be checked.
I HAVE AN QUOTE OBJECT ,NOW WHENEVER IN QUOTE OBJECT IF A FILE(eg:.pdf) IS UPLOADED A WHATSAPP NOTIFICATION GOES TO USER WHATSAPP ALONG WITH FILE........................... Any Idea Guy How To Fix This One
how to conver pdf to base6 in apex ???
Assume In an account opportunity is there then 2nd opportunity its pop up an An error else if no opportunity is there then automatic an opportunity will be created?
Whenever m insert a contact or  list of contact, same email and phone number popup an error of duplicate error
       Based on contact email and phone?
 
Account  picklist filed status__c changes to completed , when all fields are  not empty else status__c show as incomplete,,
If status__c changes to completed
,i want checkbox in all the related contact should be checked.
how to conver pdf to base6 in apex ???
Hello,

I have a flow which add informations from children records of cases.
In the text field I obtain : 1.5.663,1.5.458,1.5.663,1.4.985
I need to remove duplicates in order to display : 1.5.663,1.5.458,1.4.985

I wrote a trigger based on what I found on many forums but I'm new on Apex and I can't figure it out.

trigger Trg_Case on Case (after update) {
    For(Case myCase: Trigger.new){
        if(myCase.ChildrenVersions__c != null && (myCase.ChildrenVersions__c).contains(',')){
            string reports = myCase.ChildrenVersions__c;
            List<String> l = new List<String>(new Set<String>(reports.split(',')));
            String uniqueReports = String.join(l, ',');
        }
    }
}

Thanks for your answers
Hi All,

Went through the Apex Workbook where you construct the Merchandise__c store and wanted to figure out how to remove duplicates. The workbook suggests this can be done with a Map. I have no idea where to start. 

public class StoreFrontController{

    list<DisplayMerchandise> products;
   
   
    public list<DisplayMerchandise> getProducts(){
        if(products == null){
            products = new List<DisplayMerchandise>();
            for (Merchandise__c item : [SELECT Id, Name, Description__c, Price__c, Total_Inventory__c FROM Merchandise__c]) {
            products.add(new DisplayMerchandise(item));
            }
               

           
        }        
       return products;
    }

   
    List<DisplayMerchandise> shoppingCart = new List<DisplayMerchandise>();
    public void PageReference addToCart(){
        for(DisplayMerchandise p : products){
        if(0 < p.qtyToBuy){

            shoppingCart.add(p);
            }
       
               
        }

    }
    public String getCartContents() {
        if(0 == shoppingCart.size()) {
        return '(empty)';
        }
       
       
        String msg = '<ul>\n';
        for(DisplayMerchandise p : shoppingCart){
        msg += '<li>';
        msg += p.name  + '(' + p.qtyToBuy + ')';
        msg += '</li>\n';
       
        }
        msg += '</ul>';
        return msg;
   
    }
   


public class DisplayMerchandise{

private Merchandise__c merchandise;
public DisplayMerchandise(Merchandise__c item){

this.merchandise = item;

}

public String name {

get{return merchandise.Name;}

}

   
public String description{

get {return merchandise.Description__c;}

}

public Decimal price {

get{return merchandise.Price__c;}

}

public Boolean inStock{

get{return(0 < merchandise.Total_Inventory__c);}

}

public Integer qtyToBuy{get;set;}

}


}