• springerwa
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies

I am using the Simple Quotes app from Force.com along with the improvements suggested in this post Creating Professional PDF Documents with CSS and Visualforce and since our Product Descriptions are sometimes very long I am having difficulty with locked in pagination.

 

The code right now asks you to set a private static Integer (code below)

 

 

//controls how many quote line items are displayed on page 1
private static Integer FIRST_BREAK = 8;
//controls how many quote line items are displayed on subsequent pages
private static Integer SUBSEQ_BREAKS = 10;

public List<Quote_Item__c[]> pageBrokenQuoteItems {get; private set; }

 

and that works for about 30% of our Quotes...however, due to long Product Descriptions it doesn't work for the other 70%.

 

What I would like to do is create 2 fields on the quote line item object (FIRST_BREAK__c and SUBSEQ_BREAKS__c) and default them to 8 and 10 respectively and then have the class read the number from the fields so the user can change the numbers to change the page break where it makes sense.

 

Can someone assist with how to change so these integers are pulled from the record if the user changes them?

 

 

Related Page Break Code:

 

//splits the quote lines into an approximate number of rows that can be 
//displayed per page
private void prepareQuoteLinesForPrinting()
{
pageBrokenQuoteItems = new List<Quote_Item__c[]>();

Quote_Item__c[] pageOfQuotes = new Quote_Item__c[]{};
Integer counter = 0;

boolean firstBreakFound = false;
//boolean setSubSeqBreak = false;
//Integer breakPoint = FIRST_BREAK;

for(Quote_Item__c q : quoteLineItems)
{
if(!firstBreakFound)
{
if(counter < FIRST_BREAK)
{
pageofQuotes.add(q);
counter++;
}
if(counter == FIRST_BREAK)
{
firstBreakFound = true;
counter = 0;
pageBrokenQuoteItems.add(pageOfQuotes);
pageOfQuotes=new Quote_Item__c[]{};
}
}
else
{
if(counter<SUBSEQ_BREAKS)
{
pageofQuotes.add(q);
counter++;
}
if(counter == SUBSEQ_BREAKS)
{
counter = 0;
pageBrokenQuoteItems.add(pageOfQuotes);
pageOfQuotes=new Quote_Item__c[]{};
}
}
}
//if we have finished looping and have some quotes left lets assign them
if(!pageOfQuotes.isEmpty())
pageBrokenQuoteItems.add(pageOfQuotes);
}

 

 

 

I downloaded Find Nearby Accounts program from AppExchange but the Distance column is incorrectly sorting values less than 10 (example: 11.4 22.3 6.4 ) Has anyone found a solution to this they can share?

I would like to make a separate VF page with 3 file upload sections (Upload Document "A", Upload Document "B", Upload Document "C") or even just custom buttons name "Doc A", "Doc B", "Doc C" that when used to attach a file will mark a corresponding checkbox to checked:

Document "A" attached?   

Document "B" attached?   

Document "C" attached?   

 

We are having trouble with getting our staff to check the box after they have uploaded a "specific" document and it seems like I can bind that action into the act of uploading the attachment somehow...but I don't know where to begin or what the best methodology is for this.

 

Any suggestions? or examples of similar solutions?

I have the following "Summary" Visualforce Page selectively showing fields and related lists from Opportunity.  I want the user to be able to add a new note by clicking a "New" button from this screen but I have not been able to find the syntax for an Opportunity Note.

 

Relevant PageBlock section and the code in Red that throws the error:

 

Can anyone assist with the correct code to add a new Opportunity Note from this VisualForce page?

 

<apex:pageBlock title="Notes"> <apex:pageBlockButtons > <apex:commandButton action="/002/e?parentid={!opportunity.id}" value="New Note"/>

</apex:pageBlockButtons> <apex:pageBlockTable value="{!Opportunity.Notes}" var="note"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!note.id}">Link</a> </div> </apex:column> <apex:column value="{!note.createddate}" width="120px"/> <apex:column value="{!note.createdbyid}" width="120px"/> <apex:column value="{!note.body}" /> </apex:pageBlockTable> </apex:pageBlock>

 

 

 

 

Entire Page Code:

<apex:page standardController="Opportunity" standardStylesheets="true" showHeader="false" sidebar="false" tabStyle="Opportunity"> <table width="98%" height="50%" border="0" cellpadding="0" cellspacing="0"> </table> <apex:form > <apex:pageBlock title="Opportunity Strategy - Details"> <apex:pageBlockSection title="Opportunity Information" columns="3"> <apex:pageBlockSectionItem > <apex:outputLabel value="Opportunity" for="opportunity"/> <a href="/{!opportunity.Id}">{!opportunity.Name }</a> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Account" for="account"/> <a href="/{!Opportunity.Account.id}">{!Opportunity.Account.Name}</a> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="State" for="state"/> <apex:outputField id="address" value="{!Opportunity.Account.BillingState}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Account Type" for="industry"/> <apex:outputField id="industry" value="{!Opportunity.Account.Type}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Stage" for="stage"/> <apex:outputField id="stage" value="{!Opportunity.Stagename}" style="{!if(Opportunity.StageName='Red','background-color:#FE2E2E', if(Opportunity.StageName='Green','background-color:#00FF80',if(Opportunity.stagename='Yellow','background-color:#F3F781','color:black')))};width: 80px; text-align: right;"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Amount" for="amount"/> <apex:outputField id="amount" value="{!Opportunity.Amount}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Owner" for="owner"/> <apex:outputField id="owner" value="{!Opportunity.OwnerId}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Type" for="type"/> <apex:outputField id="type" value="{!Opportunity.Account.Account_Type__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Close Date" for="closedate"/> <apex:outputField id="closedate" value="{!Opportunity.CloseDate}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Description" columns="1"> <apex:pageBlockSectionItem > <apex:outputLabel value="Description" for="description"/> <apex:outputField id="description" value="{!Opportunity.Description}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Goals and Strategies" columns="2"> <apex:pageBlockSectionItem > <apex:outputLabel value="Next Steps" for="next"/> <apex:outputField id="next" value="{!Opportunity.NextStep}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Last Activity Date" for="lastactivity"/> <apex:outputField id="lastactivity" value="{!Opportunity.lastactivitydate}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Goal/Objective" for="goal"/> <apex:outputField id="goal" value="{!Opportunity.Goal_Objective__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="ODM Strategy" for="odm"/> <apex:outputField id="odm" value="{!Opportunity.ODM_Strategy__c}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock title="Notes"> <apex:pageBlockButtons > <apex:commandButton action="/002/e?parentid={!opportunity.id}" value="New Note"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!Opportunity.Notes}" var="note"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!note.id}">Link</a> </div> </apex:column> <apex:column value="{!note.createddate}" width="120px"/> <apex:column value="{!note.createdbyid}" width="120px"/> <apex:column value="{!note.body}" /> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Pending Activity Summary"> <apex:pageBlockTable value="{!Opportunity.OpenActivities}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.status}"/> <apex:column value="{!item.istask}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whoid}"/> <apex:column value="{!item.whatid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Meeting/Events"> <apex:pageBlockTable value="{!Opportunity.Events}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whatid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Closed Activity Summary"> <apex:pageBlockTable value="{!Opportunity.Activityhistories}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.status}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whoid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Contact and Roles"> <apex:pageBlockTable value="{!Opportunity.OpportunityContactRoles}" var="item"> <apex:column value="{!item.role}" width="100px"/> <apex:column value="{!item.Contactid}"width="150px"/> <apex:column value="{!item.Contact.Account.name}" width="300px"/> <apex:column value="{!item.Contact.Title}" width="150px"/> <apex:column value="{!item.Contact.email}"width="150px"/> <apex:column value="{!item.Contact.phone}"width="150px"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>

 

I have a Custom Object that has a record for each state and our vendor for that state and a few fields about the vendor that I would like to have passed to the corresponding Account fields.

Custom Object fields:

Vendor Name

Vendor District

Vendor Number

Vendor Active?

 

Account fields:

Vendor Name

Vendor District

Vendor Number

Vendor Active?

 

Is there any way to have a trigger update all Accounts records with the vendor for a particular state if the BillingState matches the state field in the custom object?

 

I did try a VERY LONG formula field that filled these in based on state but I noticed that it put a tremendous drag on bringing up the Account Tab now and since they very rarely change (mostly Active Yes/No but Districts are evolving much more often than previously and therefore the need for an alternate solution) I thought having a trigger update the Account fields if the Custom Object fields change would be less taxing.

 

I haven't seen any posts that seem to address this and I don't want to beat my head against the wall any longer if its just not possible.

 

 

 

 

I think I have read every hit I have found on how to call "Next" and "Previous" for pagination and have spend the better part of 12 hours on this and I am hoping that its easy and I am just missing the obvious...I tried each example I have come across on the board and I cannot get the "Next" button to display the remaining records I am calling.

 

I have this same page as the examples below using the StandardController for Opportunity and the "Next" and "Previous" works just fine but the records don't sort so it is a bit messy as there are generally 70 - 90 records that fit the "where" criteria at any giving time.  I wrote the CustomController from the posts on the boards and it sorts beautifully but I can only see 20 records - so while it is no longer messy, it is useless :-(

 

If someone can offer some advice on how to have a sorted list that also paginates - I would certainly appreciate it! (all this because no one wants to READ the stages of "Green", "Yellow" and "Red" they want the row to be painted the actual colors. GEEZ!)

 

 

public with sharing class SortOps { public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator([select name, territory.name, stagename, stagenumber__c, closedate,Account.BillingCity, Account.BillingState, Account.National_Account__c, Account.National_Account_Affiliation__c,Account_Type_Profile__c,Amount,Net_Unit_Price__c,Win_Timeframe__c,Competitive_Market__c,ID_d_Financial_Buyer__c,Approval_Process_Outlined__c,APV__c,Business_Plan_Presented__c,ID_d_Referral_Network__c,Documented_Referral_Network__c,ID_d_Budget_Year__c,Executive_Level_Meeting__c,ID_d_Clinical_Champion__c,System_Quotation_Presented__c,Project_Funded__c,Customer_Targeted_Purchase__c,ID_d_Referring_Physicians__c,BoD_Approval_Received__c,CreatedDate, recordtype.name from Opportunity where stagename = 'Yellow' OR stagename = 'Green' OR stagename='Red' Order BY recordtype.name, territory.name, stagenumber__c, closedate ASC])); } return setCon; } set; } public List<Opportunity> getOpportunities() { return (List<Opportunity>) setCon.getRecords(); } public PageReference next() { return null; } public PageReference previous() { return null; } public Boolean hasPrevious { get { return setCon.getHasPrevious(); } } public Boolean hasNext { get { return setCon.getHasNext(); } } }

 

 

<apex:page Controller="SortOps" recordSetVar="{!opportunities}"> <apex:form > <style> .dateFormat{display:none;} </style> <style type="text/css"> .h1 {background-color:#D8D8D8; border-width: 2px; border-spacing: 4px; padding: 2px; border-style: inset; border-color: :#D8D8D8; border-collapse: separate;} </style> <apex:pageBlock > <apex:pagemessages /> <apex:dataTable width="100%" border="1" id="DataTable" value="{!Opportunities}" var="o" id="opp_table" style="font-size:11px;text-align: center; vertical-align:top;word-wrap: break-word;height: 20px;" headerClass="h1" columnsWidth="150,70,130,70,20,40,80,120,30,30,120,50,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,120"> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height:20px;"> <apex:facet name="header"><b>Stage</b></apex:facet> <apex:OutputText value="{!o.stagename}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px; white-space: nowrap"> <apex:facet name="header"><b>Territory</b></apex:facet> <apex:OutputText value="{!o.territory.name}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80;',if(o.stagename='Yellow','background-color:#F3F781;','color:black')))}; height: 20px; text-align: left;white-space: nowrap"> <apex:facet name="header"><b>Opportunity Name</b></apex:facet> <a href="/{!o.Id}">{!o.Name }</a> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px; white-space: nowrap"> <apex:facet name="header"><b>Billing City</b></apex:facet> <apex:outputtext value="{!o.Account.BillingCity}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Billing State</b></apex:facet> <apex:outputtext value="{!o.Account.BillingState}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>National Account</b></apex:facet> <apex:outputField value="{!o.Account.National_Account__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px;white-space: nowrap"> <apex:facet name="header"><b>National Account Affiliation</b></apex:facet> <apex:Outputfield value="{!o.Account.National_Account_Affiliation__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px;white-space: nowrap"> <apex:facet name="header"><b>Market Segment - Account</b></apex:facet> <apex:outputField value="{!o.Account_Type_Profile__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};text-align: right; height: 20px; white-space: nowrap"> <apex:facet name="header"><b>Amount</b></apex:facet> <apex:outputfield value="{!o.Amount}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};text-align: right; height: 20px; white-space: nowrap"> <apex:facet name="header"><b>Net Unit Price</b></apex:facet> <apex:outputfield value="{!o.Net_Unit_Price__c}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Win Date</b></apex:facet> <apex:outputfield value="{!o.closeDate}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px;width: 50px"> <apex:facet name="header"><b>Fiscal Period</b></apex:facet> <apex:outputField value="{!o.Win_Timeframe__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px;"> <apex:facet name="header"><b>Competitive Market?</b></apex:facet> <apex:outputField value="{!o.Competitive_Market__c}" /> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>IDd Financial Buyer?</b></apex:facet> <apex:outputField value="{!o.ID_d_Financial_Buyer__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Approval Process Outlined?</b></apex:facet> <apex:outputField value="{!o.Approval_Process_Outlined__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Customer Targeted Purchase?</b></apex:facet> <apex:outputField value="{!o.Customer_Targeted_Purchase__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>System Quotation Presented?</b></apex:facet> <apex:outputField value="{!o.System_Quotation_Presented__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};font-weight:bold; height: 20px;"> <apex:facet name="header"><b>Current Annual Patient Volume</b></apex:facet> <apex:outputfield value="{!o.APV__c}" style="width: 40px" styleClass="title"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Business Plan Presented?</b></apex:facet> <apex:outputField value="{!o.Business_Plan_Presented__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>IDd Referral Network?</b></apex:facet> <apex:outputField value="{!o.ID_d_Referral_Network__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Documented Referral Network?</b></apex:facet> <apex:outputField value="{!o.Documented_Referral_Network__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>IDd Budget Year?</b></apex:facet> <apex:outputField value="{!o.ID_d_Budget_Year__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Executive Level Meeting?</b></apex:facet> <apex:outputField value="{!o.Executive_Level_Meeting__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>IDd Clinical Champion?</b></apex:facet> <apex:outputField value="{!o.ID_d_Clinical_Champion__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>System Quotation Presented?</b></apex:facet> <apex:outputField value="{!o.System_Quotation_Presented__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>Project Funded?</b></apex:facet> <apex:outputField value="{!o.Project_Funded__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>IDd Referring Physicians?</b></apex:facet> <apex:outputField value="{!o.ID_d_Referring_Physicians__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))};height: 20px;"> <apex:facet name="header"><b>BoD Approval Received?</b></apex:facet> <apex:outputField value="{!o.BoD_Approval_Received__c}"/> </div> </apex:column> <apex:column > <div style="{!if(o.StageName='Red','background-color:#FE2E2E', if(o.StageName='Green','background-color:#00FF80',if(o.stagename='Yellow','background-color:#F3F781','color:black')))}; height: 20px;white-space: nowrap"> <apex:facet name="header"><b>Created Date</b></apex:facet> <apex:outputField value="{!o.CreatedDate}"/> </div> </apex:column> ....... </apex:dataTable> <apex:panelGrid columns="2" style="font-weight: bold;"> <apex:commandLink action="{!previous}"><font color="blue">Previous</font></apex:commandLink> <apex:commandLink action="{!next}" ><font color="blue">Next</font></apex:commandLink> </apex:panelGrid> </apex:pageBlock> </apex:form> </apex:page>

 

I have a custom field on the Account Level that will allow you to type in the name of another Account record this one is "associated" with.  While it is not a Parent/Child record, it is an association between these two Accounts that we need to track.  There will only be one "association" so I am not worried about multiples.  Of course the users don't want to type in the names of Accounts that are already in there, they would like a lookup.  I know I cannot have a lookup on a custom field on Account TO the Account again - but I would like to somehow make the custom field a picklist that shows all the current accounts (and updates dynamically as new Accounts are added) and let the user choose the appropriate one. 

 

Can someone out there point me in the right direction?  

I have the following "Summary" Visualforce Page selectively showing fields and related lists from Opportunity.  I want the user to be able to add a new note by clicking a "New" button from this screen but I have not been able to find the syntax for an Opportunity Note.

 

Relevant PageBlock section and the code in Red that throws the error:

 

Can anyone assist with the correct code to add a new Opportunity Note from this VisualForce page?

 

<apex:pageBlock title="Notes"> <apex:pageBlockButtons > <apex:commandButton action="/002/e?parentid={!opportunity.id}" value="New Note"/>

</apex:pageBlockButtons> <apex:pageBlockTable value="{!Opportunity.Notes}" var="note"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!note.id}">Link</a> </div> </apex:column> <apex:column value="{!note.createddate}" width="120px"/> <apex:column value="{!note.createdbyid}" width="120px"/> <apex:column value="{!note.body}" /> </apex:pageBlockTable> </apex:pageBlock>

 

 

 

 

Entire Page Code:

<apex:page standardController="Opportunity" standardStylesheets="true" showHeader="false" sidebar="false" tabStyle="Opportunity"> <table width="98%" height="50%" border="0" cellpadding="0" cellspacing="0"> </table> <apex:form > <apex:pageBlock title="Opportunity Strategy - Details"> <apex:pageBlockSection title="Opportunity Information" columns="3"> <apex:pageBlockSectionItem > <apex:outputLabel value="Opportunity" for="opportunity"/> <a href="/{!opportunity.Id}">{!opportunity.Name }</a> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Account" for="account"/> <a href="/{!Opportunity.Account.id}">{!Opportunity.Account.Name}</a> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="State" for="state"/> <apex:outputField id="address" value="{!Opportunity.Account.BillingState}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Account Type" for="industry"/> <apex:outputField id="industry" value="{!Opportunity.Account.Type}" /> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Stage" for="stage"/> <apex:outputField id="stage" value="{!Opportunity.Stagename}" style="{!if(Opportunity.StageName='Red','background-color:#FE2E2E', if(Opportunity.StageName='Green','background-color:#00FF80',if(Opportunity.stagename='Yellow','background-color:#F3F781','color:black')))};width: 80px; text-align: right;"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Amount" for="amount"/> <apex:outputField id="amount" value="{!Opportunity.Amount}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Owner" for="owner"/> <apex:outputField id="owner" value="{!Opportunity.OwnerId}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem dataStyle="width: 240px"> <apex:outputLabel value="Type" for="type"/> <apex:outputField id="type" value="{!Opportunity.Account.Account_Type__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Close Date" for="closedate"/> <apex:outputField id="closedate" value="{!Opportunity.CloseDate}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Description" columns="1"> <apex:pageBlockSectionItem > <apex:outputLabel value="Description" for="description"/> <apex:outputField id="description" value="{!Opportunity.Description}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Goals and Strategies" columns="2"> <apex:pageBlockSectionItem > <apex:outputLabel value="Next Steps" for="next"/> <apex:outputField id="next" value="{!Opportunity.NextStep}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Last Activity Date" for="lastactivity"/> <apex:outputField id="lastactivity" value="{!Opportunity.lastactivitydate}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Goal/Objective" for="goal"/> <apex:outputField id="goal" value="{!Opportunity.Goal_Objective__c}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="ODM Strategy" for="odm"/> <apex:outputField id="odm" value="{!Opportunity.ODM_Strategy__c}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> <apex:pageBlock title="Notes"> <apex:pageBlockButtons > <apex:commandButton action="/002/e?parentid={!opportunity.id}" value="New Note"/> </apex:pageBlockButtons> <apex:pageBlockTable value="{!Opportunity.Notes}" var="note"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!note.id}">Link</a> </div> </apex:column> <apex:column value="{!note.createddate}" width="120px"/> <apex:column value="{!note.createdbyid}" width="120px"/> <apex:column value="{!note.body}" /> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Pending Activity Summary"> <apex:pageBlockTable value="{!Opportunity.OpenActivities}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.status}"/> <apex:column value="{!item.istask}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whoid}"/> <apex:column value="{!item.whatid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Meeting/Events"> <apex:pageBlockTable value="{!Opportunity.Events}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whatid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Closed Activity Summary"> <apex:pageBlockTable value="{!Opportunity.Activityhistories}" var="item"> <apex:column width="30px"> <apex:facet name="header"><strong>Link</strong></apex:facet> <div> <a href="/{!item.id}">Link</a> </div> </apex:column> <apex:column value="{!item.summary__c}"/> <apex:column value="{!item.subject}"/> <apex:column value="{!item.status}"/> <apex:column value="{!item.activitydate}"/> <apex:column value="{!item.whoid}"/> </apex:pageBlockTable> </apex:pageBlock> <apex:pageBlock title="Contact and Roles"> <apex:pageBlockTable value="{!Opportunity.OpportunityContactRoles}" var="item"> <apex:column value="{!item.role}" width="100px"/> <apex:column value="{!item.Contactid}"width="150px"/> <apex:column value="{!item.Contact.Account.name}" width="300px"/> <apex:column value="{!item.Contact.Title}" width="150px"/> <apex:column value="{!item.Contact.email}"width="150px"/> <apex:column value="{!item.Contact.phone}"width="150px"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>

 

I would like to make a separate VF page with 3 file upload sections (Upload Document "A", Upload Document "B", Upload Document "C") or even just custom buttons name "Doc A", "Doc B", "Doc C" that when used to attach a file will mark a corresponding checkbox to checked:

Document "A" attached?   

Document "B" attached?   

Document "C" attached?   

 

We are having trouble with getting our staff to check the box after they have uploaded a "specific" document and it seems like I can bind that action into the act of uploading the attachment somehow...but I don't know where to begin or what the best methodology is for this.

 

Any suggestions? or examples of similar solutions?