function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Krrish GopalKrrish Gopal 

Creating related records in visualforce page

Hi,

 

I created the Custom object named by Tool__c and Toolkit_Lineitem__c, now i'm trying to create a custom button to generate a pdf. I create a visualforce for the same but when i save,  i have an error msg:

 

 Invalid field Tool_Lineitem__r for SObject Tool__c error

 

pls help to resolve this issue.

 

<apex:page standardController="Tool__c" title="Tool" renderAs="pdf">

<apex:form >
<head>
<style>
@page
{
size:portrait;
margin:0.20in;
}
.cellfontsize
{
font-family:calibri;
font-size:6px;
}
.cellheaderfontsize
{
font-family:Calibri;
font-size:12px;
}
</style>
</head>

<table border="0" width="100%">
<tr>
<td style="width:50%;"><apex:image url="https://krishan4184-dev-ed.my.salesforce.com/06990000000Am45" height="50" width="150"/> </td>
<td style="text-align:right;">
<span style="color:#000000;font-weight:bold;font-family:Calibri;font-size:16px;margin-left:100px;float:right;margin-top:20px;">
Exicom Tele-Systems
</span>

</td>
<hr/>
<br/>
<div style="font-size:10px;font-family:calibri;">
<center><b>D-194,3RD FLOOR, OKHLA INDUSTRIAL AREA, PHASE-I NEW DELHI-110022</b></center>
<center><b>Tel No.: 011-46601363, 46601364</b></center>
<br/>
<center><b><u>DELIVERY CHALLAN / GATE PASS</u></b></center>
</div>
</tr>
<br/>
<div style="float:left;font-family:calibri;font-size:14px;"><b>To,</b></div><div style="float:right;font-family:calibri;font-size:14px;"><b> DC / GP No.</b> &nbsp;{!Tool__c.Gate_Pass__c}</div><br/><br/>
<div style="float:left;font-family:calibri;font-size:14px;"><b>The Security Officer</b></div><div style="float:right;font-family:calibri;font-size:14px;"><b>Date</b>&nbsp;<apex:outputText value="{0,date,dd'/'MM'/'yyyy}">
<apex:param value="{!Tool__c.Date__c}"/>
</apex:outputText></div><br/><br/>

</table>
<br/>
<br/>
<div style="font-family:calibri;font-size:14px;">
Issued From : {!Tool__c.From__c} <div style="float:right;text-align:left;">Dept.: {!Tool__c.Department__c}</div><br/>
Dispatched To : {!Tool__c.Dispatch_To__c}<div style="float:right;text-align:right;">&nbsp;Ref No.: {!Tool__c.Gate_Pass__c} </div>
<br/> Please allow M/s &nbsp;&nbsp;<b>{!Tool__c.Engineer_Name__c}</b>&nbsp;to take out the following items:</div>
<br></br>
<table border="1" cellspacing="0" cellpadding="2" align="center" width="100%">
<tr>
<td class="cellheaderfontsize">
<b>S.No.</b>
</td >
<td class="cellheaderfontsize">
<b>Particular</b>
</td>
<td class="cellheaderfontsize">
<b>Description</b>
</td>
<td class="cellheaderfontsize">
<b>Quantity</b>
</td>
<td class="cellheaderfontsize">
<b>Remark</b>
</td>
</tr>
<apex:variable var="call" value="{!0}" />
<apex:repeat var="v" value="{!Tool__c.Tool_Lineitem__r}">
<apex:variable var="call" value="{!call+1}"/>
<tr>
<td style="font-family:calibri;font-size:12px;">
{!ROUND(call,0)}
</td>
<td style="font-family:calibri;font-size:12px;">
{!v.Particular__c}
</td>
<td style="font-family:calibri;font-size:12px;">
{!v.Description__c}
</td>
<td style="font-family:calibri;font-size:12px;">
{!ROUND(v.Quantity__c,0)}
</td>
<td style="font-family:calibri;font-size:12px;">
{!v.Remark__c}
</td>
</tr>
</apex:repeat>
</table>
<br/>

<div style="float:left;font-family:calibri;font-size:12px;"><b>Receipt By</b></div><div style="justify;float:right;font-family:calibri;font-size:12px;"> <b>HOD / Competent Authority </b></div><br/><br/>
<div style="font-family:calibri;font-size:14px;">Confirmation : I confirm the receipt of above mentioned material by me or by Mr. .................................. subject to
discrepancies mentioned in the receivers column, if any found by the receiver.<br/><br/></div>

<div style="page-break-after:always;font-family:calibri;font-size:12px;"> Receiver's Signature............................ &amp; Date ...........................<br/><br/>
Receiver's Name.............................</div>
</apex:form>
</apex:page>

Rahul BorgaonkarRahul Borgaonkar

Is object name Toolkit_Lineitem__c or Tool_Lineitem__r? Please confirm.

Rahul BorgaonkarRahul Borgaonkar

Is object name Toolkit_Lineitem__c or Tool_Lineitem__c? Please confirm.