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
ReneRendReneRend 

Visualforce page trying to use inputfield id attribute to update a report on the page

Hi I am trying to create a simple VF page that displays a report.

 

I have created the report and I can get it on the page.

 

What I am trying to do next is that the user could update the report by selecting a value from inputfield (that is a lookupfield and is currently working) and then the report would update by using the value received from the inputfield by clicking the button Update Report.

 

Here is the current code:

 

<apex:page standardController="Case" showHeader="false" sidebar="false">
<apex:form >
<apex:inputField value="{!Case.Program__c}" id="programname">
</apex:inputfield>
<apex:commandButton value="Update Report" >
</apex:commandbutton>
<apex:iframe src="/00OG0000004HGdT?isdtp=mn&pv1=programname"/>
</apex:form>
</apex:page>

 

If using this way I get the following text on the report

"Program contains programname"

 

So it is not using the value in ID=programname but it is using the word programname to limit the search.

Avidev9Avidev9

Well values cannot be refered by Id. In VF they are refered using merge fields

 

<apex:page standardController="Case" showHeader="false" sidebar="false">
   <apex:form >
      <apex:inputField value="{!Case.Program__c}" id="programname"></apex:inputfield>
      <apex:commandButton value="Update Report" ></apex:commandbutton>
      <apex:iframe src="/00OG0000004HGdT?isdtp=mn&pv1={!Case.Program__c}"/>
   </apex:form>
</apex:page>

 Check if the above works

ReneRendReneRend
It almost works, it is now using the value but the value is the Salesforce id instead of the actual value that is displayed:

Program equals a01G000000BBYHKIA5

ideas?
Neha LundNeha Lund

Command Button does not have action in it.

ReneRendReneRend

The default action is referesh the page an is working correctly on this part. The problem is the use if ID.

 

 

Avidev9Avidev9

Seems like Program is a lookup field to another object.

Try this

<apex:page standardController="Case" showHeader="false" sidebar="false">
   <apex:form >
      <apex:inputField value="{!Case.Program__c}" id="programname"></apex:inputfield>
      <apex:commandButton value="Update Report" ></apex:commandbutton>
      <apex:iframe src="/00OG0000004HGdT?isdtp=mn&pv1={!Case.Program__r.Name}"/>
   </apex:form>
</apex:page>
ReneRendReneRend

Di not work,

 

<apex:page standardController="Case" showHeader="false" sidebar="false">
<apex:form >
<apex:pageBlock title="Select a program that that you are interested about"></apex:pageblock>
<apex:inputField value="{!Case.Program__c}" id="programname">
</apex:inputfield>
<apex:commandButton value="Show Report" >
</apex:commandbutton>
<apex:iframe src="/00OG0000004HJXJ?isdtp=mn&pv4={!Case.Program__r.Name}"/>
</apex:form>
</apex:page>

 

I tried that already and got the following error message when trying to save:

 

Error: Unknown property 'VisualforceArrayList.Name'

 

 

Neha LundNeha Lund

What is the child relationship name for Program lookup on Case ?

ReneRendReneRend

Sorry Neha I do not understand the question:

 

What is the child relationship name for Program lookup on Case ?

Avidev9Avidev9
what kind of field is Program ?
Please put in some details. We cannot guess by looking your code
ReneRendReneRend

It is a lookup field.

Avidev9Avidev9
That doesnt help much!
Your org seems to have improper naming convention and hence there is a conflict.

try this

<apex:iframe src="/00OG0000004HGdT?isdtp=mn&pv1={!Case.Program__r[0].Name}"/>

I dont think this will be of much help. I will recommend you to use a developr
ReneRendReneRend

 

 

If I examine the Object Program:

 

It has the following fields:

 

FIELD NAME

CreatedBy

LastModifiedBy

Owner

Name

 

 

Avidev9Avidev9
As I said you seem to have a naming conflict. Well you can give a try to <apex:iframe src="/00OG0000004HGdT?isdtp=mn&pv1={!Case.Program__r[0].Name}"/>