• SazEast
  • NEWBIE
  • 85 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 8
    Replies
I have a visualforce email template that needs to read 'for more information click here'

The link is dynamic depending on the record that produces the email so the url is saved in a merge field on the record but when referencing this its not a clickable link:

You can find out more information <a href="{!relatedTo.Customobject__r.custom_url_field__c}"><strong><span style="font-size: 16px; font-family: Arial;"><strong style="font-weight: 700; color:black; font-family: Arial; font-size: 15px; text-decoration-style: underline; text-decoration-color: black !important;"><span style="font-size: 16px; font-family: Arial;">here</span></strong></span></strong></a></p>

For example:
ObjectField NameField Value
Object 1TestCar 2
Object 2Car 2Tyre
   
I want to find the value 'Tyre' from the field name Car 2 when the value of Test = 'Car2'.

I want to be able to lookup the field value on object 1 if the field name matches the field value on object 2.

Many thanks!
The below text should only be rendered if the picklist does not equal the two values but its not working, please could you help?
 
<apex:outputPanel rendered="{!IF(NOT(!relatedTo.Category__c ='Value1' || !relatedTo.Category__c ='Value 2' ,true,false))}> TEXT TO SHOW</apex:outputPanel>

 
Hello, I'm a complete newbie to API integration - I have REST web service exposed to consume third party data which is to  update records in Salesforce. I've got the JSON2Apex Class as the JSON is nested but unsure how to use this to map JSON fields/objects to Salesforce field names. I'm struggling to find any guidance online, please could someone point me in the right direction?
Hello,
Users are getting a validation error on records that are excluded from the validation rule. It should only fire for the three user profiles mentioned, and only fire if the approval status is set to 'Approved' if it was not already set to this. It also shouldn't fire if the record type is an invoice adjustment. Any ideas why this isn't working?
 
CONTAINS($Profile.Name, "Cash") ||
CONTAINS($Profile.Name, "RBC") ||
CONTAINS($Profile.Name, "Accounts Payable")


&&

ISPICKVAL(Approval_Status__c, "Approved")

&&

NOT(ISPICKVAL(PRIORVALUE(Approval_Status__c), "Approved") )

&&

RecordType.Name <> "Invoice_Adjustment"

Thanks
I'm getting a 'variable does not exist' error but it is in the wrapper class so i'm not sure what I'm doing wrong, please could you help with the test class code so I can deploy? Thanks

Wrapper Class:
public class WrapperSarah{ 

    public Consolidated_Invoicing__c consinvs;
    public WrapperSarah(ApexPages.StandardController stdController) {
       this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
       WrapperSarah wrp = new WrapperSarah();
    }
    Id recordId;
    public List<Consolidated_Invoicing__c> consolidatedInvoiceList { get; set; }
    public List<Invoice__c> invoiceList { get; set; }
    public Map<Id, List<Invoice__c>> coninvIdinvListMap { get ; set; }
    Set<Id> invoiceIds = new Set<Id>();
    Id Consolidated_InvoiceId = ApexPages.currentPage().getParameters().get('consId');
    Map<Id, Consolidated_Invoicing__c> memberMap = new Map<Id, Consolidated_Invoicing__c>();
    public List<ConsolidatedInvoiceWrapperSarah> consolidatedInvoiceWrapperSarahList { get; set; }
    
    public WrapperSarah() {   
      consolidatedInvoiceList = [SELECT  Total__c, Name FROM Consolidated_Invoicing__c 
    Where Id =: ApexPages.currentPage().getParameters().get('id')];
        coninvIdinvListMap = new Map<Id, List<Invoice__c>>();
        consolidatedInvoiceWrapperSarahList = new List<ConsolidatedInvoiceWrapperSarah>();
        if(consolidatedInvoiceList.size() > 0) {
            for (Consolidated_Invoicing__c cons: consolidatedInvoiceList) {
            invoiceIds.add(cons.Id);
            memberMap.put(cons.Id, cons);
            }
          invoiceList = [SELECT Name, Consolidated_Invoice__c, Patient_Name__c, PatientNameString__c,  Hospital_Treated__c, Policy_Number__c, Consultant__c, DOB__c, (SELECT Name, Charge_Description__c, Charge_Code__c, Net_Price__c, Gross_Price__c, Line__c, Quantity__c, VAT__c, Date__c FROM Treatments__r) 
                FROM Invoice__c 
                WHERE Consolidated_Invoice__c IN : invoiceIds];
            system.debug('Invoice List is ' + invoiceList);
        }
        if(invoiceList.size() > 0) {
            for(Invoice__c intrst : invoiceList) {
                if(!coninvIdinvListMap.containsKey(intrst.Consolidated_Invoice__c)){
                    coninvIdinvListMap.put(intrst.Consolidated_Invoice__c, new List<Invoice__c>());
                }
                coninvIdinvListMap.get(intrst.Consolidated_Invoice__c).add(intrst);
            }
            for(Id invoiceId : coninvIdinvListMap.keySet()) {
                consolidatedInvoiceWrapperSarahList.add(new ConsolidatedInvoiceWrapperSarah(memberMap.get(invoiceId), coninvIdinvListMap.get(invoiceId)));
            }
        }        
    }     
    public class ConsolidatedInvoiceWrapperSarah {
        public Consolidated_Invoicing__c consinv { get; set; }
        public List<Invoice__c> invclist { get; set; }        
        public ConsolidatedInvoiceWrapperSarah(Consolidated_Invoicing__c consinv, List<Invoice__c> invclist) {
           this.consinv= consinv;
           this.invclist = invclist;
           
                          
       
        }    
        
      }
      
      
}

Test Class:
 
@IsTest private class TestWrapperSarah {
    @IsTest
       private static void WrapperSarah(){
           
           Consolidated_Invoicing__c ci = new Consolidated_Invoicing__c(status__c='sent');
			insert ci;
           
           string invclist=ci.ID;

           
           Invoice__c ni = new Invoice__c();
           ni.Consolidated_Invoice__c = ci.Id;
           ni.Name = 'Fake';
           insert ni;
           
           Treatment__c nt = new Treatment__c();
           nt.Invoice__c = ni.Id;
           nt.Charge_Code__c = 'Fake Code';
           nt.Date__c = Date.Today();
           nt.Net_Price__c = 100.10;
           insert nt;
           
              Test.StartTest();

     	WrapperSarah co = new WrapperSarah();
      
           
          system.assertEquals(1,WrapperSarah.invclist.size());
           
           Test.stopTest();      
           

     }    
}

 
I have an apex:data table using width attributes but the alignment of the columns is not straight, for example:

Out of line columns
I have text-align but how can I align / fix the columns? 

Thanks
 
It works fine on my main page but on the embedded page its displaying the css code as text on the output.

Thanks
Hello,

I have a wrapper extension class that's intended to bring back grandchild records for a pageblock table within a Visualforce page. However, I keep getting errors when trying to save the Visualforce page referencing the extension controller. I'm not sure if there's a problem with the extension controller or the Visualforce page? Please see code below, any help is greatly appreciated!

VF Page:

<apex:page standardController="Consolidated_Invoicing__c" extensions="WrapperSarah"  renderas="pdf">

Extension Controller:

public class WrapperSarah{ 
private final Consolidated_Invoicing__c consinvs;
    public WrapperSarah(ApexPages.StandardController stdController) {
this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
    }

Can provide the full code if needed but only getting errors after this has been added in following a salesforce guide.

Thanks!
How do I display only the current record rather than all records of an object (consolidated invoicing in this instance) using a custom wrapper class and visualforce page with an apex pageblocktable that shows the related records to the current object record (ie, all invoices and then treatments related to Consolidated invoices)?

Parent: Consolidated Invoicing
Child: Invoice
GrandChild: Treatments

I've created a wrapper class:

public class Wrapper{ 
    public List<Consolidated_Invoicing__c> consolidatedInvoiceList { get; set; }
    public List<Invoice__c> invoiceList { get; set; }
    public Map<Id, List<Invoice__c>> coninvIdinvListMap { get; set; }
    Set<Id> invoiceIds = new Set<Id>();
    Map<Id, Consolidated_Invoicing__c> memberMap = new Map<Id, Consolidated_Invoicing__c>();
    
    public List<ConsolidatedInvoiceWrapper> consolidatedInvoiceWrapperList { get; set; }

    public Wrapper() {   
        consolidatedInvoiceList = [SELECT  Total__c, Name FROM Consolidated_Invoicing__c];
        coninvIdinvListMap = new Map<Id, List<Invoice__c>>();
        consolidatedInvoiceWrapperList = new List<ConsolidatedInvoiceWrapper>();
        if(consolidatedInvoiceList.size() > 0) {
            for(Consolidated_Invoicing__c cons: consolidatedInvoiceList) {
                invoiceIds.add(cons.Id);
                memberMap.put(cons.Id, cons);
            }
            invoiceList = [SELECT Name, Consolidated_Invoice__c, (SELECT Name, Charge_Description__c FROM Treatments__r) FROM Invoice__c WHERE Consolidated_Invoice__c IN : invoiceIds];
            system.debug('Invoice List is ' + invoiceList);
        }
        if(invoiceList.size() > 0) {
            for(Invoice__c intrst : invoiceList) {
                if(!coninvIdinvListMap.containsKey(intrst.Consolidated_Invoice__c)){
                    coninvIdinvListMap.put(intrst.Consolidated_Invoice__c, new List<Invoice__c>());
                }
                coninvIdinvListMap.get(intrst.Consolidated_Invoice__c).add(intrst);
            }
            for(Id invoiceId : coninvIdinvListMap.keySet()) {
                consolidatedInvoiceWrapperList.add(new ConsolidatedInvoiceWrapper(memberMap.get(invoiceId), coninvIdinvListMap.get(invoiceId)));
            }
        }
    } 
    
    public class ConsolidatedInvoiceWrapper{
        public Consolidated_Invoicing__c consinv { get; set; }
        public List<Invoice__c> invclist { get; set; }
        
        public ConsolidatedInvoiceWrapper(Consolidated_Invoicing__c consinv, List<Invoice__c> invclist) {
            this.consinv= consinv;
            this.invclist = invclist;
        }
    }
}

And the the Visualforce page:

<apex:page Controller="Wrapper" renderas="pdf">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockTable value="{!consolidatedInvoiceWrapperList}" var="W">
        <apex:column headerValue="Consolidated Invoice Number" value="{!W.consinv.Name}"/>
        <apex:column headerValue="Total Amount Due" value="{!W.consinv.Total__c}"/>
        <apex:column >
            <apex:pageblockTable value="{!W.invclist }" var="I">
                <apex:column headerValue= "Invoice Number" value="{!I.Name}"/>
                <apex:column >
                    <apex:pageBlockTable value="{!I.Treatments__r}" var="E">
                        <apex:column headerValue="Charge Code" value="{!E.Name}"/>
                        <apex:column headerValue= "Description" value="{!E.Charge_Description__c}"/>
                    </apex:pageBlockTable>
                </apex:column>
            </apex:pageblockTable>
        </apex:column>
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Is there something obvious i'm missing?

Thanks




 
I'm using the Build Your Own Template in Community Builder, how do I add a standard or custom Edit button to the Record Detail Page?

For example:
ObjectField NameField Value
Object 1TestCar 2
Object 2Car 2Tyre
   
I want to find the value 'Tyre' from the field name Car 2 when the value of Test = 'Car2'.

I want to be able to lookup the field value on object 1 if the field name matches the field value on object 2.

Many thanks!
The below text should only be rendered if the picklist does not equal the two values but its not working, please could you help?
 
<apex:outputPanel rendered="{!IF(NOT(!relatedTo.Category__c ='Value1' || !relatedTo.Category__c ='Value 2' ,true,false))}> TEXT TO SHOW</apex:outputPanel>

 
Hello, I'm a complete newbie to API integration - I have REST web service exposed to consume third party data which is to  update records in Salesforce. I've got the JSON2Apex Class as the JSON is nested but unsure how to use this to map JSON fields/objects to Salesforce field names. I'm struggling to find any guidance online, please could someone point me in the right direction?
Hello,
Users are getting a validation error on records that are excluded from the validation rule. It should only fire for the three user profiles mentioned, and only fire if the approval status is set to 'Approved' if it was not already set to this. It also shouldn't fire if the record type is an invoice adjustment. Any ideas why this isn't working?
 
CONTAINS($Profile.Name, "Cash") ||
CONTAINS($Profile.Name, "RBC") ||
CONTAINS($Profile.Name, "Accounts Payable")


&&

ISPICKVAL(Approval_Status__c, "Approved")

&&

NOT(ISPICKVAL(PRIORVALUE(Approval_Status__c), "Approved") )

&&

RecordType.Name <> "Invoice_Adjustment"

Thanks
I'm getting a 'variable does not exist' error but it is in the wrapper class so i'm not sure what I'm doing wrong, please could you help with the test class code so I can deploy? Thanks

Wrapper Class:
public class WrapperSarah{ 

    public Consolidated_Invoicing__c consinvs;
    public WrapperSarah(ApexPages.StandardController stdController) {
       this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
       WrapperSarah wrp = new WrapperSarah();
    }
    Id recordId;
    public List<Consolidated_Invoicing__c> consolidatedInvoiceList { get; set; }
    public List<Invoice__c> invoiceList { get; set; }
    public Map<Id, List<Invoice__c>> coninvIdinvListMap { get ; set; }
    Set<Id> invoiceIds = new Set<Id>();
    Id Consolidated_InvoiceId = ApexPages.currentPage().getParameters().get('consId');
    Map<Id, Consolidated_Invoicing__c> memberMap = new Map<Id, Consolidated_Invoicing__c>();
    public List<ConsolidatedInvoiceWrapperSarah> consolidatedInvoiceWrapperSarahList { get; set; }
    
    public WrapperSarah() {   
      consolidatedInvoiceList = [SELECT  Total__c, Name FROM Consolidated_Invoicing__c 
    Where Id =: ApexPages.currentPage().getParameters().get('id')];
        coninvIdinvListMap = new Map<Id, List<Invoice__c>>();
        consolidatedInvoiceWrapperSarahList = new List<ConsolidatedInvoiceWrapperSarah>();
        if(consolidatedInvoiceList.size() > 0) {
            for (Consolidated_Invoicing__c cons: consolidatedInvoiceList) {
            invoiceIds.add(cons.Id);
            memberMap.put(cons.Id, cons);
            }
          invoiceList = [SELECT Name, Consolidated_Invoice__c, Patient_Name__c, PatientNameString__c,  Hospital_Treated__c, Policy_Number__c, Consultant__c, DOB__c, (SELECT Name, Charge_Description__c, Charge_Code__c, Net_Price__c, Gross_Price__c, Line__c, Quantity__c, VAT__c, Date__c FROM Treatments__r) 
                FROM Invoice__c 
                WHERE Consolidated_Invoice__c IN : invoiceIds];
            system.debug('Invoice List is ' + invoiceList);
        }
        if(invoiceList.size() > 0) {
            for(Invoice__c intrst : invoiceList) {
                if(!coninvIdinvListMap.containsKey(intrst.Consolidated_Invoice__c)){
                    coninvIdinvListMap.put(intrst.Consolidated_Invoice__c, new List<Invoice__c>());
                }
                coninvIdinvListMap.get(intrst.Consolidated_Invoice__c).add(intrst);
            }
            for(Id invoiceId : coninvIdinvListMap.keySet()) {
                consolidatedInvoiceWrapperSarahList.add(new ConsolidatedInvoiceWrapperSarah(memberMap.get(invoiceId), coninvIdinvListMap.get(invoiceId)));
            }
        }        
    }     
    public class ConsolidatedInvoiceWrapperSarah {
        public Consolidated_Invoicing__c consinv { get; set; }
        public List<Invoice__c> invclist { get; set; }        
        public ConsolidatedInvoiceWrapperSarah(Consolidated_Invoicing__c consinv, List<Invoice__c> invclist) {
           this.consinv= consinv;
           this.invclist = invclist;
           
                          
       
        }    
        
      }
      
      
}

Test Class:
 
@IsTest private class TestWrapperSarah {
    @IsTest
       private static void WrapperSarah(){
           
           Consolidated_Invoicing__c ci = new Consolidated_Invoicing__c(status__c='sent');
			insert ci;
           
           string invclist=ci.ID;

           
           Invoice__c ni = new Invoice__c();
           ni.Consolidated_Invoice__c = ci.Id;
           ni.Name = 'Fake';
           insert ni;
           
           Treatment__c nt = new Treatment__c();
           nt.Invoice__c = ni.Id;
           nt.Charge_Code__c = 'Fake Code';
           nt.Date__c = Date.Today();
           nt.Net_Price__c = 100.10;
           insert nt;
           
              Test.StartTest();

     	WrapperSarah co = new WrapperSarah();
      
           
          system.assertEquals(1,WrapperSarah.invclist.size());
           
           Test.stopTest();      
           

     }    
}

 
Hello,

I have a wrapper extension class that's intended to bring back grandchild records for a pageblock table within a Visualforce page. However, I keep getting errors when trying to save the Visualforce page referencing the extension controller. I'm not sure if there's a problem with the extension controller or the Visualforce page? Please see code below, any help is greatly appreciated!

VF Page:

<apex:page standardController="Consolidated_Invoicing__c" extensions="WrapperSarah"  renderas="pdf">

Extension Controller:

public class WrapperSarah{ 
private final Consolidated_Invoicing__c consinvs;
    public WrapperSarah(ApexPages.StandardController stdController) {
this.consinvs = (Consolidated_Invoicing__c)stdController.getRecord();
    }

Can provide the full code if needed but only getting errors after this has been added in following a salesforce guide.

Thanks!
How do I display only the current record rather than all records of an object (consolidated invoicing in this instance) using a custom wrapper class and visualforce page with an apex pageblocktable that shows the related records to the current object record (ie, all invoices and then treatments related to Consolidated invoices)?

Parent: Consolidated Invoicing
Child: Invoice
GrandChild: Treatments

I've created a wrapper class:

public class Wrapper{ 
    public List<Consolidated_Invoicing__c> consolidatedInvoiceList { get; set; }
    public List<Invoice__c> invoiceList { get; set; }
    public Map<Id, List<Invoice__c>> coninvIdinvListMap { get; set; }
    Set<Id> invoiceIds = new Set<Id>();
    Map<Id, Consolidated_Invoicing__c> memberMap = new Map<Id, Consolidated_Invoicing__c>();
    
    public List<ConsolidatedInvoiceWrapper> consolidatedInvoiceWrapperList { get; set; }

    public Wrapper() {   
        consolidatedInvoiceList = [SELECT  Total__c, Name FROM Consolidated_Invoicing__c];
        coninvIdinvListMap = new Map<Id, List<Invoice__c>>();
        consolidatedInvoiceWrapperList = new List<ConsolidatedInvoiceWrapper>();
        if(consolidatedInvoiceList.size() > 0) {
            for(Consolidated_Invoicing__c cons: consolidatedInvoiceList) {
                invoiceIds.add(cons.Id);
                memberMap.put(cons.Id, cons);
            }
            invoiceList = [SELECT Name, Consolidated_Invoice__c, (SELECT Name, Charge_Description__c FROM Treatments__r) FROM Invoice__c WHERE Consolidated_Invoice__c IN : invoiceIds];
            system.debug('Invoice List is ' + invoiceList);
        }
        if(invoiceList.size() > 0) {
            for(Invoice__c intrst : invoiceList) {
                if(!coninvIdinvListMap.containsKey(intrst.Consolidated_Invoice__c)){
                    coninvIdinvListMap.put(intrst.Consolidated_Invoice__c, new List<Invoice__c>());
                }
                coninvIdinvListMap.get(intrst.Consolidated_Invoice__c).add(intrst);
            }
            for(Id invoiceId : coninvIdinvListMap.keySet()) {
                consolidatedInvoiceWrapperList.add(new ConsolidatedInvoiceWrapper(memberMap.get(invoiceId), coninvIdinvListMap.get(invoiceId)));
            }
        }
    } 
    
    public class ConsolidatedInvoiceWrapper{
        public Consolidated_Invoicing__c consinv { get; set; }
        public List<Invoice__c> invclist { get; set; }
        
        public ConsolidatedInvoiceWrapper(Consolidated_Invoicing__c consinv, List<Invoice__c> invclist) {
            this.consinv= consinv;
            this.invclist = invclist;
        }
    }
}

And the the Visualforce page:

<apex:page Controller="Wrapper" renderas="pdf">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockTable value="{!consolidatedInvoiceWrapperList}" var="W">
        <apex:column headerValue="Consolidated Invoice Number" value="{!W.consinv.Name}"/>
        <apex:column headerValue="Total Amount Due" value="{!W.consinv.Total__c}"/>
        <apex:column >
            <apex:pageblockTable value="{!W.invclist }" var="I">
                <apex:column headerValue= "Invoice Number" value="{!I.Name}"/>
                <apex:column >
                    <apex:pageBlockTable value="{!I.Treatments__r}" var="E">
                        <apex:column headerValue="Charge Code" value="{!E.Name}"/>
                        <apex:column headerValue= "Description" value="{!E.Charge_Description__c}"/>
                    </apex:pageBlockTable>
                </apex:column>
            </apex:pageblockTable>
        </apex:column>
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Is there something obvious i'm missing?

Thanks