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
developerindudeveloperindu 

Conditional check in Visualforce page

Hi,

 

I'm a starter to Visualforce page and have built a basic page with will render a PDF with an Object "A" and a table displays another object records ("A-child") which has master detail with Object "A".

 

Now, I want to display the child records based on a Status field in the child object. Eg: Only the child records having Status as "Closed" should be displayed in the PDF. Can somebody pls guide me on this?

info.shailinfo.shail

Not 100% sure about your requirement but if you want to display the child records of master which has staus ="Closed" then you can query on child and store records in list.

e.g.

List<ChildObject> lstChild= [Select Id, Name,.......... from ChildObject where Status='Closed' and Panenrtd='idfromconstructor'];

 

idfromconstructor is parent id you can find in extension constructor

 

 

developerindudeveloperindu

Hi,

 

I will give u my sample code...please let me know where I can insert the conditional check here for Status = closed only, I want to display below records in table format...

 

<apex:pageBlockTable value="{!Lines__r}" var="ord">

<apex:column headervalue="Units"> <apex:outputfield value="{!ord.Quantity__c}"/> </apex:column>