• Olivia Forde
  • NEWBIE
  • 65 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 26
    Replies
I want our Live Agent chat button to appear as a floating button on our website (just like the feedback button on this site) or the one here https://www.intercom.com/ does anyone know how to do that 
I am creating record swith Process builder but I only want to create the record if none already exist. The record is a Related Object of an Account - how do I check if there is one there already and then skip the process (or better still update the existing record)
I have this trigger and I want to change it to select 1 Gateway ID if the currency of the Opportunity is x and if the Brand on the product is Y ( Through Opportunity Product and Product) or select Gateway 2 if something else etc

trigger UpdateGateway on OpportunityLineItem (after insert, after update) {

 
 Id GatewayId = 'a012000001k5yoK'; 
Set<id>ids=new set<id>();

list<opportunity> oplst=new list<opportunity>();

    For(OpportunityLineItem ol:trigger.new){
        if(ol.Continuity__c == True){
            ids.add(ol.opportunityid);
        }

    }

    if(!ids.Isempty()){

        list<opportunity >opp=[select id,CSFA__Gateway__c from Opportunity where id in:ids];

        for(Opportunity op:opp){

                op.CSFA__Gateway__c= GatewayId;
           
                oplst.add(op);

            }

        

        update oplst;

    }  

}
I am rendering a URL within a Viscualforce HTML Email template but the dates are in European Date/Time how do I sent them to the URL in mm/dd/yyyy format.

This is the code I have 
<a href="http://xxxxl.naxxxxrvar.com/xxx/tracking/{!relatedTo.Freight_Carrier__c}?tracking_numbers={!relatedTo.Tracking_Number__c}
&order_number={!relatedTo.Name}&service={!relatedTo.Service__c}&ozip=91406&dzip={!relatedTo.ChargentSFA__Shipping_Zip__c}
&order_date={!relatedTo.CloseDate}&ship_date={!relatedTo.Dispatch_Date__c}"
style="background-color:#a41d57;border:1px solid #dbdbdb;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:200px;-webkit-text-size-adjust:none;mso-hide:all; align; margin: 10px;">Track My Package</a>
 
Hi
The Save button n my VF Form is not returning to the VIew Page so it is not obviouse that the record has saved. This is the controller code
    public PageReference save(){
        try{            
            
            upsert editItem;
                        
            system.debug(BusUnits.keyset());
                        
            for(String key:BusUnits.keyset()){
                if(BusUnits.get(key) == true){
                    tempMarketItem = MarketItems.get(key);
                    system.debug(tempMarketItem);
                    if(tempMarketItem.Items__c == null){
                        tempMarketItem.Items__c = editItem.id;
                    }
                    tempMarketItem.Business_Unit__c = key;
                    system.debug(tempMarketItem);                    
                    MarketItems.put(key, tempMarketItem);
                    upsert MarketItems.get(key);
                    for(integer i : numberOfDates.get(key)){
                        if((i < numberOfDates.get(key).size()) && (effectiveDates.get(key).get(i).Effective_Date__c != null)){
                            
                            tempED = new Effective_Date__c();
                            tempED = effectiveDates.get(key).get(i);
                            if(tempED.Market_Item__c == null){
                              tempED.Market_Item__c = MarketItems.get(key).Id;  
                            } 
                            effectiveDates.get(key).put(i, tempED);
                            upsert effectiveDates.get(key).get(i);
                        }
                        
                    }
                }    
                system.debug('BusUnitsOld' +BusUnitsOld);
                system.debug('BusUnits' +BusUnits);                
                if((MarketItems.get(key).Business_Unit__c == key) && (BusUnits.get(key) == false)){
                    delete MarketItems.get(key);
                }       
            }
                        
            PageReference home = new PageReference('/'+editItem.id);
            
            home.setRedirect(true);
            return home;
            
        }
        catch (Exception ex){
            ApexPages.addMessages(ex);
            system.debug(ex);
            return null;
        }
    }


And teh Form code
<apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save" id="theButton"/>        
        </apex:pageBlockButtons>
I want to create a CASE statement for a frmula field that does this
if  x or y = true then
A
if x and y = true
B
else
C
Hi
I have the following piece of code in an Apex Class
 
    public class LineItem {
        public String productCode {get; set;}
        public String productName {get; set;}
        public Decimal quantity {get; set;}
        public Decimal unitPrice {get; set;}
        public Decimal ListEX {get; set;}
        public Decimal ListSubtotal {get; set;}
        public Decimal VAT {get; set;}
        public Decimal subTotal {get; set;}
        public Decimal totalWithVAT {get; set;}
        
        
        public LineItem(String productCode, String productName, Decimal quantity, Decimal unitPrice, Decimal VAT , Decimal ListEX, Decimal ListSubtotal) {
            this.productCode = productCode;
            this.productName = productName;
            this.quantity = quantity;
            this.unitPrice = unitPrice;
            this.ListEX = ListEX ;
            this.ListSubtotal = ListSubtotal ;
            if ( VAT == null ) {
                this.VAT = 0.0;
            } else {
                this.VAT = VAT;
            }
            this.subTotal = (this.quantity * this.unitPrice).setScale(2);
            this.totalWithVAT = (this.quantity * (this.unitPrice + this.VAT)).setScale(2);
        }

I want to change how subTotal is calculated , I want to use a new field instead of unitPrice - how do I do that 
I want to do this
<apex:outputText value="  Date {0,date,dd.MM.yyyy}">
                    <apex:param value="{!opportunity.CloseDate}" />
                    </apex:outputText>

and display it within a table like this

<tr>
                    <td  style="height: 15px; border-bottom: 1px solid #cccccc;border-right: 1px solid #cccccc;">Date</td>
                    <td style="border-bottom: 1px solid #cccccc;">{!opportunity.closedate}</td>
                 
                </tr>
 
Hi All
I am trying to change the columns shown on a Page so I need to knwo how to refer to the fields the current ones are referenced like this
<th class="number">{!trnDiscount}</th>

So how do I add new fields



 
I have a VF page which has a section with fields from a child object - these fields are required but I can still save the page if these fields are not completed. How do I force users to fill the fields on a child object.
​What is the user experience like compare to class room based ?
tempListED = [SELECT Id, Market_Item__c, Cost_Price__c, Transfer_Price__c, Effective_Date__c, Transfer_Price_Effective_Date__c, Transfer_Price_Currency__c FROM Effective_Date__c WHERE Market_Item__c = :tempMI.Id];
            for(integer i=1 ; i <= tempListED.size() ; i++ ){
                system.debug(tempListED.size());
                system.debug(numberOfDates.get(tempMI.Business_Unit__c));
                tempED = new Effective_Date__c();
                //tempListED.add(tempED);
                numberOfDates.get(tempMI.Business_Unit__c).add(i+1);
                effectiveDates.get(tempMI.Business_Unit__c).put(i, tempListED[i-1]);
                effectiveDates.get(tempMI.Business_Unit__c).put(i+1, tempED);
I have this code
</apex:outputPanel>    
               <apex:outputPanel id="BU_Codes" >
                    <apex:repeat value="{!BUs}" var="BU">
                     <apex:pageBlockSection title="{!BU + ' Bar Codes'}" collapsible="false" rendered="{!BusUnits[BU]}">
                          <apex:inputField value="{!editItem.OTR_UPC_Code__c}"/>
                          <apex:inputField value="{!editItem.EA_UPC_Code__c}"/>
                          bucodes
                    </apex:pageBlockSection>            
                    </apex:repeat>
                </apex:outputPanel>
                
                <apex:outputPanel id="BU_Codes2" >
                    <apex:repeat value="{!BUs}" var="BU">
                       <apex:pageBlockSection title="{!BU + ' Bar Codes'}" collapsible="false" rendered="{!BusUnits[BU]}">
                          <apex:inputField value="{!editItem.OTR_EAN_Code__c}"/>
                          <apex:inputField value="{!editItem.EA_EAN_Code__c}"/>
                          bucodes2
                       </apex:pageBlockSection>       
                    </apex:repeat>
                </apex:outputPanel> 

which I believed would show the relevant fields depening on which check box was selected by using this

<apex:panelGroup >
                        <apex:inputCheckbox label="CA" value="{!BusUnits['CA']}" >
                            <apex:actionSupport event="onchange" rerender="BU_Codes2,BU_Effective_Dates"/>
                        </apex:inputCheckbox>
                        <apex:outputLabel value="CA"/>
                    </apex:panelGroup>
                    
                   <apex:panelGroup >
                        <apex:inputCheckbox label="US" value="{!BusUnits['US']}">
                            <apex:actionSupport event="onchange" rerender="BU_Codes,BU_Effective_Dates"/>
                        </apex:inputCheckbox>
                        <apex:outputLabel value="US"/>
                    </apex:panelGroup>

but both are shown and if I enter different data for two BU's only one is saved and is shown for both
Any ideas what I have done wrong ?
I have a VF page and the save button saves the data but not the data to the child object
I want to replace the  standard View page with my own page but when I do it comes up editable I need it to be View only and then ad an Edit Button
I have the following code to display 33 tick boxes and their labels but I cannot get the column number combintaion correct top display properly on teh VF page (this is code someone else wrote). I am changing the number of columns but I cannot see the correlation between what I enter and what I display. 

<apex:pageBlockSection title="BU's" columns="1" >
                <apex:panelGrid columns="1">
I want to step into the code running on a VF page to see why a section is rendering when I dont think it should be - how can  I do this ?
I have a Visualforce Edit Page and I want some of the fields to display readonlyI have tried this
<apex:outputfield value="{!Item.Item_Code__c}"/> but it only displays the label
On a Visualforce form I am using a rerender based on checkboxes and I want to set the Currency at this point also based on the checkbox - can this be done ?
I am doing this  
<apex:panelGroup >            
            <apex:inputCheckbox label="CA" value="{!BusUnits['CA']}" >                
            <apex:actionSupport event="onchange" rerender="BU_Options"/>                
        </apex:inputCheckbox>                
        <apex:outputLabel value="CA"/>              
      </apex:panelGroup>


 and I want to do this  


 <apex:panelGroup >                  
      <apex:inputCheckbox label="CA" value="{!BusUnits['CA']}" >            
                <apex:actionSupport event="onchange" rerender="BU_Options"/>
<apex:actionSupport event="onchange" rerender="BU_Codes2"/>        
              </apex:inputCheckbox>                
        <apex:outputLabel value="CA"/>            
        </apex:panelGroup>
I have this trigger and I want to change it to select 1 Gateway ID if the currency of the Opportunity is x and if the Brand on the product is Y ( Through Opportunity Product and Product) or select Gateway 2 if something else etc

trigger UpdateGateway on OpportunityLineItem (after insert, after update) {

 
 Id GatewayId = 'a012000001k5yoK'; 
Set<id>ids=new set<id>();

list<opportunity> oplst=new list<opportunity>();

    For(OpportunityLineItem ol:trigger.new){
        if(ol.Continuity__c == True){
            ids.add(ol.opportunityid);
        }

    }

    if(!ids.Isempty()){

        list<opportunity >opp=[select id,CSFA__Gateway__c from Opportunity where id in:ids];

        for(Opportunity op:opp){

                op.CSFA__Gateway__c= GatewayId;
           
                oplst.add(op);

            }

        

        update oplst;

    }  

}
Hi
The Save button n my VF Form is not returning to the VIew Page so it is not obviouse that the record has saved. This is the controller code
    public PageReference save(){
        try{            
            
            upsert editItem;
                        
            system.debug(BusUnits.keyset());
                        
            for(String key:BusUnits.keyset()){
                if(BusUnits.get(key) == true){
                    tempMarketItem = MarketItems.get(key);
                    system.debug(tempMarketItem);
                    if(tempMarketItem.Items__c == null){
                        tempMarketItem.Items__c = editItem.id;
                    }
                    tempMarketItem.Business_Unit__c = key;
                    system.debug(tempMarketItem);                    
                    MarketItems.put(key, tempMarketItem);
                    upsert MarketItems.get(key);
                    for(integer i : numberOfDates.get(key)){
                        if((i < numberOfDates.get(key).size()) && (effectiveDates.get(key).get(i).Effective_Date__c != null)){
                            
                            tempED = new Effective_Date__c();
                            tempED = effectiveDates.get(key).get(i);
                            if(tempED.Market_Item__c == null){
                              tempED.Market_Item__c = MarketItems.get(key).Id;  
                            } 
                            effectiveDates.get(key).put(i, tempED);
                            upsert effectiveDates.get(key).get(i);
                        }
                        
                    }
                }    
                system.debug('BusUnitsOld' +BusUnitsOld);
                system.debug('BusUnits' +BusUnits);                
                if((MarketItems.get(key).Business_Unit__c == key) && (BusUnits.get(key) == false)){
                    delete MarketItems.get(key);
                }       
            }
                        
            PageReference home = new PageReference('/'+editItem.id);
            
            home.setRedirect(true);
            return home;
            
        }
        catch (Exception ex){
            ApexPages.addMessages(ex);
            system.debug(ex);
            return null;
        }
    }


And teh Form code
<apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save" id="theButton"/>        
        </apex:pageBlockButtons>
I want to create a CASE statement for a frmula field that does this
if  x or y = true then
A
if x and y = true
B
else
C
Hi
I have the following piece of code in an Apex Class
 
    public class LineItem {
        public String productCode {get; set;}
        public String productName {get; set;}
        public Decimal quantity {get; set;}
        public Decimal unitPrice {get; set;}
        public Decimal ListEX {get; set;}
        public Decimal ListSubtotal {get; set;}
        public Decimal VAT {get; set;}
        public Decimal subTotal {get; set;}
        public Decimal totalWithVAT {get; set;}
        
        
        public LineItem(String productCode, String productName, Decimal quantity, Decimal unitPrice, Decimal VAT , Decimal ListEX, Decimal ListSubtotal) {
            this.productCode = productCode;
            this.productName = productName;
            this.quantity = quantity;
            this.unitPrice = unitPrice;
            this.ListEX = ListEX ;
            this.ListSubtotal = ListSubtotal ;
            if ( VAT == null ) {
                this.VAT = 0.0;
            } else {
                this.VAT = VAT;
            }
            this.subTotal = (this.quantity * this.unitPrice).setScale(2);
            this.totalWithVAT = (this.quantity * (this.unitPrice + this.VAT)).setScale(2);
        }

I want to change how subTotal is calculated , I want to use a new field instead of unitPrice - how do I do that 
I want to do this
<apex:outputText value="  Date {0,date,dd.MM.yyyy}">
                    <apex:param value="{!opportunity.CloseDate}" />
                    </apex:outputText>

and display it within a table like this

<tr>
                    <td  style="height: 15px; border-bottom: 1px solid #cccccc;border-right: 1px solid #cccccc;">Date</td>
                    <td style="border-bottom: 1px solid #cccccc;">{!opportunity.closedate}</td>
                 
                </tr>
 
Hi All
I am trying to change the columns shown on a Page so I need to knwo how to refer to the fields the current ones are referenced like this
<th class="number">{!trnDiscount}</th>

So how do I add new fields



 
I have a VF page which has a section with fields from a child object - these fields are required but I can still save the page if these fields are not completed. How do I force users to fill the fields on a child object.
Hi All,

 While upload the data's via dataloader how to map the record id automatically instead of Export the Record Id and manually mapping the CSV file.
I have this code
</apex:outputPanel>    
               <apex:outputPanel id="BU_Codes" >
                    <apex:repeat value="{!BUs}" var="BU">
                     <apex:pageBlockSection title="{!BU + ' Bar Codes'}" collapsible="false" rendered="{!BusUnits[BU]}">
                          <apex:inputField value="{!editItem.OTR_UPC_Code__c}"/>
                          <apex:inputField value="{!editItem.EA_UPC_Code__c}"/>
                          bucodes
                    </apex:pageBlockSection>            
                    </apex:repeat>
                </apex:outputPanel>
                
                <apex:outputPanel id="BU_Codes2" >
                    <apex:repeat value="{!BUs}" var="BU">
                       <apex:pageBlockSection title="{!BU + ' Bar Codes'}" collapsible="false" rendered="{!BusUnits[BU]}">
                          <apex:inputField value="{!editItem.OTR_EAN_Code__c}"/>
                          <apex:inputField value="{!editItem.EA_EAN_Code__c}"/>
                          bucodes2
                       </apex:pageBlockSection>       
                    </apex:repeat>
                </apex:outputPanel> 

which I believed would show the relevant fields depening on which check box was selected by using this

<apex:panelGroup >
                        <apex:inputCheckbox label="CA" value="{!BusUnits['CA']}" >
                            <apex:actionSupport event="onchange" rerender="BU_Codes2,BU_Effective_Dates"/>
                        </apex:inputCheckbox>
                        <apex:outputLabel value="CA"/>
                    </apex:panelGroup>
                    
                   <apex:panelGroup >
                        <apex:inputCheckbox label="US" value="{!BusUnits['US']}">
                            <apex:actionSupport event="onchange" rerender="BU_Codes,BU_Effective_Dates"/>
                        </apex:inputCheckbox>
                        <apex:outputLabel value="US"/>
                    </apex:panelGroup>

but both are shown and if I enter different data for two BU's only one is saved and is shown for both
Any ideas what I have done wrong ?
I have a VF page and the save button saves the data but not the data to the child object
I want to replace the  standard View page with my own page but when I do it comes up editable I need it to be View only and then ad an Edit Button
I have the following code to display 33 tick boxes and their labels but I cannot get the column number combintaion correct top display properly on teh VF page (this is code someone else wrote). I am changing the number of columns but I cannot see the correlation between what I enter and what I display. 

<apex:pageBlockSection title="BU's" columns="1" >
                <apex:panelGrid columns="1">
I have a Visualforce Edit Page and I want some of the fields to display readonlyI have tried this
<apex:outputfield value="{!Item.Item_Code__c}"/> but it only displays the label