-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
3Questions
-
2Replies
Visualforce page export: reference fields from another object using Looklook field
I've created a Visualforce page to export an MS word version of a contract, based on Standard Controller Contract fields.
I've created a custom lookup field in the Contract page layout, in order to pull the correponding Opportunity into the Contract page information. What I'm hoping to be able to do is reference fields in the corresponding Opportunity in the visualforce contract export.
I've looked into some table options e.g.
<apex:pageBlockTable value={!list} var="item"> <apex:column value="{!item.Opportunity__r.Status__c}"/> <apex:column value="{!item.Price__c}"/> </apex:pageBlockTable>The problem is referencing the corrsponding Opportunity. I've also looked into some cross-reference field solutions, but ideally I'd like to avoid adding more custom forumula fields to the Contract layout, just to make the UX easier to manage
Any suggestions would be much appreciated.
- Calvin Barr
- April 27, 2018
- Like
- 0
- Continue reading or reply
visualforce word export: add text based on checkbox status
I added the following pageblock information in the place in the contract where the I want the text to conditionally appear, but I keep getting an error on the input field. Do I need to add something to controller or header?
Much appreciated
<apex:page standardController="Contract"
-
-
-
<apex:pageBlock id="theBlock">
<apex:inputCheckbox value="{!My_Checkox__c}">
<apex:actionSupport event="onchange" rerender="theBlock"/>
</apex:inputCheckbox>
<apex:inputText value="THE TEXT I WANT TO DISPLAY" rendered="{!(My_Checkox__c == true)}"/>
</apex:pageBlock>
-
-
-
</apex:page>
- Calvin Barr
- April 17, 2018
- Like
- 0
- Continue reading or reply
Show errors on blank fields when generating a PDF
Hello,
I’m trying to create an Opportunity-controlled Visualforce page that creates a quote, but throws an error when custom opportunity fields are NULL when generating a PDF via a Button in the Opportunity layout.
The goal is to be able to keep updating opportunity fields, but only get warning messages if the fields required for a quote are left blank
I found some sample code that makes sense it, but I’m a beginner, so I’m not sure where to house the Apex Code to apply it to the VF Page
Visualforce Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <apex:page standardController="Account" extensions="ErrorMessageInVfController"> <apex:form > <apex:pageblock > <apex:pageMessages id="showmsg"></apex:pageMessages> <apex:panelGrid columns="2"> Account Name: <apex:inputText value="{!acc.name}"/> Account Number: <apex:inputText value="{!acc.AccountNumber}"/> Account Phone: <apex:inputText value="{!acc.phone}"/> Account Site: <apex:inputText value="{!acc.site}"/> Account Industry: <apex:inputText value="{!acc.industry}"/> <apex:commandButton value="Update" action="{!save}" style="width:90px" rerender="showmsg"/> </apex:panelGrid> </apex:pageblock> </apex:form> </apex:page> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | public with sharing class ErrorMessageInVfController { public Account acc{get;set;} public ErrorMessageInVfController(ApexPages.StandardController controller) { acc = new Account(); } public void save(){ if(acc.name == '' || acc.name == null) ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter Account name')); if(acc.AccountNumber == '' || acc.AccountNumber == null) ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter Account number')); if(acc.phone == '' || acc.phone == null) ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Account phone')); if(acc.site == '' || acc.site == null) ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'Please enter Account site')); if(acc.industry == '' || acc.industry == null) ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM,'Please enter Account industry')); } } |
Any direction be much appreciated :)
- Calvin Barr
- September 08, 2016
- Like
- 0
- Continue reading or reply
visualforce word export: add text based on checkbox status
I added the following pageblock information in the place in the contract where the I want the text to conditionally appear, but I keep getting an error on the input field. Do I need to add something to controller or header?
Much appreciated
<apex:page standardController="Contract"
-
-
-
<apex:pageBlock id="theBlock">
<apex:inputCheckbox value="{!My_Checkox__c}">
<apex:actionSupport event="onchange" rerender="theBlock"/>
</apex:inputCheckbox>
<apex:inputText value="THE TEXT I WANT TO DISPLAY" rendered="{!(My_Checkox__c == true)}"/>
</apex:pageBlock>
-
-
-
</apex:page>
- Calvin Barr
- April 17, 2018
- Like
- 0
- Continue reading or reply