So I'm still very new to coding and Apex. I have a custom object called Invoice that is a part of a managed package that some users in my org do not have access to. So basically what I'm trying to do is build a visualforce page that gives them a window into viewing invoices without having to purchase extra licenses. They don't need to edit anything, they just need basic information from invoices. I created a very basic controller and VF page, but obviously it still doesn't work because they don't have access to invoices.
My Controller:
public class Test_SC_INV_VF_Controller {
private final Service_Call__c sc;
public Invoice__c inv;
public Test_SC_INV_VF_Controller(ApexPages.StandardController stdController) {
this.sc = (Service_Call__c)stdController.getRecord();
}
public Invoice__c getInvoice() {
inv = [select Id, Name, Invoice_Notes__c From Invoice__c
where Service_Call__c = :sc.Id];
return inv;
}
}
My VF Page:
<apex:page standardController="Service_Call__c" extensions="Test_SC_INV_VF_Controller">
INV: {!invoice.name}
</apex:page>
I guess my question is, is there any way to save multiple values in strings in the controller and then pass them over to the VF page? Or will I have to create a getInvoiceName() method and another getInvoiceTotal() method and so on to get individual values to display on VF page?
Thanks in advance!