• Ktobener
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I've been working on a Visualforce page that displays An account, it's child charitable contributions, and then offers the user the ability to select accounts to recieve charitable donations. The list of accounts is parsed in through the URL. I have the page looking perfect exactly as I'd like (See screen shot below)

 

VF Screen Shot

 

 

The trouble exists when I go to process the selected orders. The selections made on the page do not appear in the class as selected. I confirmed that I can hardcode the list of orders as selected in the class and they will appear checked in the page, but I cannot make the logic work in the other direction. I'm wondering if this has something to do with the nesting of the repeat within a pageblocktable? If anyone has a sense of where I'm making a mistake I'd greatly appreciate it. I can probably solve the problem with javascript, but I'd love to improve my skills with visualforce and apex! I've included the portions of the page and class that I think are relevant, but I can include all the relevant code if there is a piece of the puzzle missing.

 

 

Page Snippet:

<apex:pageBlockTable value="{!Account.Food_Donation_Contributions__r}" var="c" cellpadding="4" id="contributetable">
<apex:column headerValue="Contribution Name" value="{!c.Name}"/>
<apex:column headerValue="Product Type" value="{!c.Product_Type__c}"/>
<apex:column headerValue="Remaining Packs" value="{!c.Total_Remaining_Packs__c}"/>
<apex:column headerValue="Remaining Cases" value="{!c.Total_Remaining_Cases__c}"/>
<apex:column headerValue="Remaining Pallets" value="{!c.Total_Remaining_Pallets__c}"/>
<apex:column headerValue="Choose Recieving Accounts">
<table width="600" border="0">
<tr>
<th align="left">Target Account:</th>
<th align="left">Account Information:</th>
<th align="right">Select</th>
</tr>
<apex:repeat value="{!orders}" var="o">
<apex:outputpanel >
<tr>
<td align="left">{!o.awoname}</td>
<td align="left">Sample Program 1, Sample Program 2, Sample Program 3</td>
<td align="right" width="35"><apex:inputCheckbox value="{!o.selected}"/></td>
</tr>
</apex:outputpanel>
</apex:repeat>
</table>
</apex:column>
</apex:pageBlockTable>
<BR/><BR/><BR/><BR/><BR/>
</apex:pageBlock>
</apex:form>

 

 

Controller Snippet:

 

public pagereference processSelected(){

/*We create a new list of Orders that we be populated only with Ordersif they are selected*/

List<PFD_AWO_Order__c> selectedorders = new List<PFD_AWO_Order__c>();

/*We will cycle through our list of cOrders and will check to see if the
selected property is set to true, if it is we add the Order to the selectedorders list. */
for(cOrder cO : orderList){
if(cO.selected == true){
selectedorders.add(cO.order);
}
}

/* Now we have our list of selected orders and can perform any type of
logic here. In this instance, when active, we will insert the list of orders. */


for(PFD_AWO_Order__c AWOORDER : selectedOrders){
ordermessage = ordermessage + '[Order from'+AWOORDER.PFD_Contribution__c +' for ' +AWOORDER.Animal_Welfare_Org__c+' ]';
}

insert selectedorders;
return null;
}

 

 

Thanks!

 

 

Hello!

 

I've been working on adding multi-currency support to a future app exchange product, and I'm having trouble finding the right logic to set my quote.currencyisocode dynamically.

 

 

first I tried:

sobject oppriso = quote.getSObject('Opportunity__r.CurrencyIsoCode');

quote.putObject('CurrencyIsoCode', oppriso);

 

then:

sobject oppriso = quote.getSObject('Opportunity__r').get('CurrencyIsoCode');

quote.putObject('CurrencyIsoCode', oppriso);

 


And then I thought maybe:

quote.putObject('CurrencyIsoCode',(string)quote.getSObject('Opportunity__r').get('CurrencyIsoCode'));

 

 

All of these methods return compile errors relating to sobject/string type problems. I spent all night working on this, so maybe I'm just snowblind so to speak. Is there a dynamic method for putting a string into a string field on an object?

I'm creating a visualforce page for a client that allows the organization to view their opportunities and assosiated opportunity products with in-line edit abilities for the opportunity products. I've made the page successfully, but I need a controller extension to update the opportunity products, and this is where I've been running into trouble. Having never built an extension, I've been trying to customize examples from the help and the community boards but nothing has worked yet. I would really appreciate some help from somebody!

 

 

 

 

 

Page:

 

<apex:page standardcontroller="Opportunity" extensions="OLIControllerextensionTEST" recordSetVar="Opportunity" tabStyle="opportunity" sidebar="true">
<apex:form id="theForm">
<apex:pageBlock >
      <apex:pageBlockButtons location="top">
         <apex:commandButton value="Save" action="{!save}"/>
         <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
  <apex:pageBlockTable value="{!Opportunity}" var="o">
      <apex:column >         
          <h3>Opportunity Information for Opportunity:&nbsp;&nbsp;</h3> <apex:outputLink value="/{!o.id}" id="theLink">{!o.name}</apex:outputLink>
          <br/><br/>
            <table border="0" >
            <tr>
            <th>Opportunity Name</th>
                <th>Account Name</th>
                <th>Amount</th>
                <th>Close Date</th>
                <th>Stage Value</th>
            </tr>
            <tr>
            <td><apex:inputField value="{!o.name}"/></td>
                <td>{!o.Account.BillingCity}</td>
                <td>{!o.Amount}</td>
                <td><apex:outputText value="{0,date,MM-dd-yyyy}"><apex:param value="{!o.CloseDate}"/></apex:outputText></td>
                               
        <td>{!o.StageName}</td>
             </tr>
       </table>
          <br/><br/>
          <h2>Related Opportunity Products:</h2>
            <table border="0">
            <tr>
              <th align="left">Product&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
              <th>Date</th>
              <th align="left">Quantity</th>
              <th align="left">Sales Price</th>
              <th align="left">Total Price</th>
              <th>Revenue Model</th>
              <th>Bundle</th>
              <th>Duration (months)</th>
              <th>Number Resources</th>
            </tr>
            <apex:repeat value="{!o.OpportunityLineItems}" var="oli">
            <tr>
              <td><apex:inputField value="{!oli.PricebookEntry.Name}"/></td>
              <td><apex:inputField value="{!oli.ServiceDate}"/></td>
              <td><apex:inputField value="{!oli.Quantity}"/></td>
              <td><apex:inputField value="{!oli.PricebookEntry.UnitPrice}"/></td>
              <td><apex:inputField value="{!oli.TotalPrice}"/></td>
              <td><apex:inputField value="{!oli.Revenue_Method__c}"/></td>
              <td><apex:inputField value="{!oli.Bundle__c}"/></td>
              <td><apex:inputField value="{!oli.Advisory_Duration_Months__c}"/></td>
              <td><apex:inputField value="{!oli.Number_Staff__c}"/></td>
            </tr>
            </apex:repeat>          
            </table>
            <br/><br/>                
      </apex:column> 
  </apex:pageBlockTable>

    <apex:panelGrid columns="2">
      <apex:commandLink action="{!previous}">Previous</apex:commandlink>
      <apex:commandLink action="{!next}">Next</apex:commandlink>
    </apex:panelGrid>
   
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

This is the controller extension I got to work on another visualforce page with the opp id in the url and an opportunity standard controller, but I would love if I could find a way to work this into a visualforce page with multiple opps/olis on it!

 

 

Controller Extension:

 

public class OLIControllerextensionTEST {


private Opportunity opp;
    public OLIControllerextensionTEST(ApexPages.StandardController controller) {
        this.opp = (Opportunity)controller.getRecord();

   }
   
   
    public PageReference mySave() {
        update opp.OpportunityLineItems;
        return null;
    }
}

 

 

 

Any help? :)

I'm using Informatica On Demand to perform a data loading project. On the 'Cases' object, I have several lookup fields that I'm setting with External ID's, including lookups to Assets, Contracts, and Accounts. The problem is that many Cases have null fields for Asset, Contracts, or Account ID's because not all of the callers had one or all of these in the system. I would like to use an expression to reference the external ID if the field is not null.

 

 

Is there a way to use the expression functions IIF and ISNULL to build such a function into a field expression space?

 

Thanks for the help!

I've been working on a Visualforce page that displays An account, it's child charitable contributions, and then offers the user the ability to select accounts to recieve charitable donations. The list of accounts is parsed in through the URL. I have the page looking perfect exactly as I'd like (See screen shot below)

 

VF Screen Shot

 

 

The trouble exists when I go to process the selected orders. The selections made on the page do not appear in the class as selected. I confirmed that I can hardcode the list of orders as selected in the class and they will appear checked in the page, but I cannot make the logic work in the other direction. I'm wondering if this has something to do with the nesting of the repeat within a pageblocktable? If anyone has a sense of where I'm making a mistake I'd greatly appreciate it. I can probably solve the problem with javascript, but I'd love to improve my skills with visualforce and apex! I've included the portions of the page and class that I think are relevant, but I can include all the relevant code if there is a piece of the puzzle missing.

 

 

Page Snippet:

<apex:pageBlockTable value="{!Account.Food_Donation_Contributions__r}" var="c" cellpadding="4" id="contributetable">
<apex:column headerValue="Contribution Name" value="{!c.Name}"/>
<apex:column headerValue="Product Type" value="{!c.Product_Type__c}"/>
<apex:column headerValue="Remaining Packs" value="{!c.Total_Remaining_Packs__c}"/>
<apex:column headerValue="Remaining Cases" value="{!c.Total_Remaining_Cases__c}"/>
<apex:column headerValue="Remaining Pallets" value="{!c.Total_Remaining_Pallets__c}"/>
<apex:column headerValue="Choose Recieving Accounts">
<table width="600" border="0">
<tr>
<th align="left">Target Account:</th>
<th align="left">Account Information:</th>
<th align="right">Select</th>
</tr>
<apex:repeat value="{!orders}" var="o">
<apex:outputpanel >
<tr>
<td align="left">{!o.awoname}</td>
<td align="left">Sample Program 1, Sample Program 2, Sample Program 3</td>
<td align="right" width="35"><apex:inputCheckbox value="{!o.selected}"/></td>
</tr>
</apex:outputpanel>
</apex:repeat>
</table>
</apex:column>
</apex:pageBlockTable>
<BR/><BR/><BR/><BR/><BR/>
</apex:pageBlock>
</apex:form>

 

 

Controller Snippet:

 

public pagereference processSelected(){

/*We create a new list of Orders that we be populated only with Ordersif they are selected*/

List<PFD_AWO_Order__c> selectedorders = new List<PFD_AWO_Order__c>();

/*We will cycle through our list of cOrders and will check to see if the
selected property is set to true, if it is we add the Order to the selectedorders list. */
for(cOrder cO : orderList){
if(cO.selected == true){
selectedorders.add(cO.order);
}
}

/* Now we have our list of selected orders and can perform any type of
logic here. In this instance, when active, we will insert the list of orders. */


for(PFD_AWO_Order__c AWOORDER : selectedOrders){
ordermessage = ordermessage + '[Order from'+AWOORDER.PFD_Contribution__c +' for ' +AWOORDER.Animal_Welfare_Org__c+' ]';
}

insert selectedorders;
return null;
}

 

 

Thanks!

 

 

Hello!

 

I've been working on adding multi-currency support to a future app exchange product, and I'm having trouble finding the right logic to set my quote.currencyisocode dynamically.

 

 

first I tried:

sobject oppriso = quote.getSObject('Opportunity__r.CurrencyIsoCode');

quote.putObject('CurrencyIsoCode', oppriso);

 

then:

sobject oppriso = quote.getSObject('Opportunity__r').get('CurrencyIsoCode');

quote.putObject('CurrencyIsoCode', oppriso);

 


And then I thought maybe:

quote.putObject('CurrencyIsoCode',(string)quote.getSObject('Opportunity__r').get('CurrencyIsoCode'));

 

 

All of these methods return compile errors relating to sobject/string type problems. I spent all night working on this, so maybe I'm just snowblind so to speak. Is there a dynamic method for putting a string into a string field on an object?

I'm using Informatica On Demand to perform a data loading project. On the 'Cases' object, I have several lookup fields that I'm setting with External ID's, including lookups to Assets, Contracts, and Accounts. The problem is that many Cases have null fields for Asset, Contracts, or Account ID's because not all of the callers had one or all of these in the system. I would like to use an expression to reference the external ID if the field is not null.

 

 

Is there a way to use the expression functions IIF and ISNULL to build such a function into a field expression space?

 

Thanks for the help!

Order_Offers custom object related to opportunity (M/D). I can display the Order Offers without any issue.

When I use an input field it will display the correct text, but the save function doesn't save the data into the related record. Is a controller extension required for saving multiple records at a time? If so, can anyone point me to an code example of this nature?

PS. Where is the insert code button, or what is the HTML code to do so?

Thanks,
John

apex:page standardController="opportunity" sidebar="false" showHeader="false" renderAs="HTML">
<br>.TextAreaLarge {width:400px; height:250px;}<br>

apex:pageblock title="Order Information">
apex:outputtext >
Order Number: {!Opportunity.Order_Number__c}

Order Placer: {!Opportunity.Order_Placer__c}



Account: {!Opportunity.Account.Name}

/apex:outputtext>
/apex:pageblock>

apex:pageblock title="Circulation & Cost">
apex:outputText value="Order Total Cost: ${!Opportunity.Amount}"/>

apex:outputText value="Total Order Circulation: {!Opportunity.Circulation__c}" style=""/>
/apex:pageblock>

apex:form >
apex:pageblock >
apex:pageblocktable value="{!Opportunity.Order_Offers__r}" var="offer">
apex:column headervalue="Disclaimer 1">
apex:inputfield value="{!offer.Offer_Disclaimer_1__c}" styleClass="TextAreaLarge"/>
/apex:column>
apex:column headervalue="Disclaimer 2">
apex:inputtextarea value="{!offer.Offer_Disclaimer_2__c}"/>
/apex:column>
/apex:pageblocktable>
apex:commandButton value="Save" action="{!save}"/>
apex:commandbutton value="Cancel" action="{!cancel}"/>
/apex:pageblock>
/apex:form>

apex:pageblock title="Stores">
apex:pageblocktable value="{!Opportunity.Store_Entries__r}" var="store">
apex:column value="{!store.Store__c}"/>
apex:column value="{!store.Circulation__c}"/>
apex:column value="{!store.Directionals__c}"/>
/apex:pageblocktable>
/apex:pageblock>
/apex:page>

Hi All,

 

I created a small visualforce page with an actionsupport within a outputfield.. but for some reason the "action" method is not getting called..

 

 

<apex:page standardcontroller="Account" extensions="inlineediting"> <apex:form> <apex:pageblock> <apex:outputPanel id="outpanel"> <apex:outputpanel> <apex:outputfield value="{!Account.Name}" rendered="{!readonlymode}"> <apex:actionSupport event="onclick" action="{!inlineedit}" rerender="outpanel"/> </apex:outputfield> <apex:inputfield value="{!Account.Name}" rendered="{!editmode}"/> </apex:outputpanel> </apex:outputPanel> </apex:pageblock> </apex:form> </apex:page>

 thanks for any help...