You need to sign in to do that
Don't have an account?

Unknown property 'VisualforceArrayList.CommercientSF8__INVNUMBER__c'
Hello,
I am trying to create my first VF page that has a table, the first field of the first column is a child of Account (Account.name) . the second one (Invoice Date) is a child of that child. but for the second one I am getting this error. I tried different things but it is not working. the second part of my code is the other way that I tried but getting errors.
Would you please help me with that?
Here is my page:
<apex:page standardController="Account" readOnly="true" renderAs="pdf">
<div class="bPageBlock">
<div class="pbBody" style="padding: 0; margin: 0; vertical-align: top; color: #000; display: block;">
<table class="detailList" border="0.5" cellpadding="0" cellspacing="0" >
<tbody>
<tr>
<td class="labelCol">Account</td>
<td class="dataCol" id="Acc_cell">
<div id="Acc_inner">
<apex:outputlink value="/{!Account.Name}">{!Account.Name}</apex:outputlink>
</div>
</td>
<apex:variable var="inv" value="{!Account.CommercientSF8__SAGE300_Invoice_Headers__r}"/>
<td class="labelCol">Invoice Date</td>
<td class="dataCol" >
<div id="inv_inner">
<apex:outputlink value="/{!inv.CommercientSF8__INVNUMBER__c}">{!inv.CommercientSF8__INVNUMBER__c </apex:outputlink>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<apex:pageBlock>
<apex:pageBlockSection title="SAGE300 Invoice Lines">
<apex:pageBlockTable value="{!CommercientSF8__SAGE300_InvoiceHeader__c.CommercientSF8__SAGE300_Invoice_Lines__r}" var="inv2">
<apex:outputField value="{!inv2.Name}"/>
<apex:outputField value="{!inv2.CommercientSF8__DESC__c}"/>
<apex:outputField value="{!inv2.CommercientSF8__PRIUNTPRC__c}"/>
<apex:outputField value="{!inv2.CommercientSF8__QTYSHIPPED__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
I am trying to create my first VF page that has a table, the first field of the first column is a child of Account (Account.name) . the second one (Invoice Date) is a child of that child. but for the second one I am getting this error. I tried different things but it is not working. the second part of my code is the other way that I tried but getting errors.
Would you please help me with that?
Here is my page:
<apex:page standardController="Account" readOnly="true" renderAs="pdf">
<div class="bPageBlock">
<div class="pbBody" style="padding: 0; margin: 0; vertical-align: top; color: #000; display: block;">
<table class="detailList" border="0.5" cellpadding="0" cellspacing="0" >
<tbody>
<tr>
<td class="labelCol">Account</td>
<td class="dataCol" id="Acc_cell">
<div id="Acc_inner">
<apex:outputlink value="/{!Account.Name}">{!Account.Name}</apex:outputlink>
</div>
</td>
<apex:variable var="inv" value="{!Account.CommercientSF8__SAGE300_Invoice_Headers__r}"/>
<td class="labelCol">Invoice Date</td>
<td class="dataCol" >
<div id="inv_inner">
<apex:outputlink value="/{!inv.CommercientSF8__INVNUMBER__c}">{!inv.CommercientSF8__INVNUMBER__c </apex:outputlink>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<apex:pageBlock>
<apex:pageBlockSection title="SAGE300 Invoice Lines">
<apex:pageBlockTable value="{!CommercientSF8__SAGE300_InvoiceHeader__c.CommercientSF8__SAGE300_Invoice_Lines__r}" var="inv2">
<apex:outputField value="{!inv2.Name}"/>
<apex:outputField value="{!inv2.CommercientSF8__DESC__c}"/>
<apex:outputField value="{!inv2.CommercientSF8__PRIUNTPRC__c}"/>
<apex:outputField value="{!inv2.CommercientSF8__QTYSHIPPED__c}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
CommercientSF8__SAGE300_Invoice_Headers__r is a list of child records, not the records themselves. So when you do this:
You're trying to access 'CommercientSF8__INVNUMBER__c' on a *list* instead of a specific record.
You need to either pull a specific element from the list or loop over the list before you can pull specific values from it.
Thank you for your answer. So how can I loop over the list before pulling that specific value ? Because I have a list of companies and each company has 1000 of invoices , and what i want to do is when then click on a invoice number in a page that shows the list of invoices , it goes to a pdf page for that invoice and shows this table.
I searched and I found <apex:repeat> , even though I am not sure how to use it.
For <apex:repeat> the "value" attribute is some sort of list to loop over. The 'var' is the variable that represents each item of that list as you loop over it.
Whatever you put inside of the repeat block will repeat for each item in the list. So when you use "{!inv.CommercientSF8__INVNUMBER__c}" it will actually use the value for that item in the list.
Here is my code:
<td class="labelCol">Invoice Number</td>
<td class="dataCol">
<div id="invnum_inner">
<apex:repeat value="{!Account.CommercientSF8__SAGE300_Invoice_Headers__r}" var="inv">
<apex:outputlink value="/{!inv.CommercientSF8__INVNUMBER__c}">
{!inv.CommercientSF8__INVNUMBER__c}
</apex:outputlink>
</apex:repeat>
</div>
</td>
Am i missing something?
I want to create something like this:
There is an Account, in Account I have Invoice Header(CommercientSF8__SAGE300_InvoiceHeader__c) which has its own fields and the child of Invoice Header is (CommercientSF8__SAGE300_InvoiceLine__c).
First I show Account.name
Then, I want to show Invoice number which is a field in Invoice Line. (Invoice line is a child of a child of Account)
I hope I could clarify it well.
That loops through each of your invoices and creates a table with the account name and invoice information. You may need to adjust a little to pull the information you want from the invoice but I think it will get you close to where you want.
Thank you again John , I am not able to see the result of my changes because of this error "Response size exceeded 15MB organization limit ".
The extra HTML in my last response is repeated for *every* invoice so if there are a lot of them it will make the page too large.
There are things you can do to limit this. One would be to minimize the markup - remove any unnecessary DOM elements in that loop.
There are more suggestions in this answer (http://salesforce.stackexchange.com/questions/12734/visualforce-response-size-exceeded) on the Salesforce Stack Exchange.
So you mean that <apex:repeat> here makes the details for all invoices ? or just the one that I clicked on from Invoice Header ?
My page is already a readOnly page. I tried to remove the unnecessary <div></div> that I used for table cells, still I am getting the error . my first table has 9 fields and my second one has 4 fields.
Making the page readOnly won't help here because that only affects the number of rows you can return from a SOQL query (up to 1,000,000) and the number of items you can loop over in <apex:repeat> (up to 10,000).
There is still an overall limit of 15 MB for the total response size of the page. It almost certainly stems from looping over all possible Invoice Headers for the account. Can you limit how many you're returning and page them? Or only show the most recent?
first table is Invoices_Header which is a child of Account. So when you click on the Name in this table you should go to another page which has a table in it. (I already have this table up and running)
Second table has the information of Invoices_Line which is a child of Invoices_Header
so i want it to take the Account.name and that specific Invoice number and so on .... same thing for the second table (SAGE300 invoices line) I need the Name of that product,description,... which are fields in Invoices_Line. ( here some fields are empty just because I entered the values by hand to show you what i need, but if it works all the fields suppose to get their values automatically)
Id value 0M0150000008Pf1 is not valid for the CommercientSF8__SAGE300_InvoiceHeader__c standard controller
"
I tried different ways to write the id, I tried :
?id= (ID on that specific Invoice header) --> ?id=00N1500000GCY4o&id=0011500001LFTw7
?id= (ID on that specific Invoice header) &id= (Invoice Line for that account) --> ?id=00N1500000GCY4o&id=0011500001LFTw7&id=15000005XKNO
?id= (Invoice header from Workbench ) --> ?id=0M0150000008Pf1CAE
Would you please help me with that?
Account(top of the tree) ------------------------------------------------------------------------------------------------> (Account Field) Name
|
|
|
|----------------------------->Invoice Header (Account Child)----------------------------------------> (Invoice Header Field) Invoice number
| ----------------------------------------> (Invoice Header Field) Order number
|
|
|
|---------------> Invoice Line (Invoice Header Child)----------> (Invoice Line Field) Name
----------> (Invoice Line Field) Description
----------> (Invoice Line Field) Price
----------> (Invoice Line Field) Quantity