• Lee Yakiwchuk
  • NEWBIE
  • 10 Points
  • Member since 2014
  • Solution Architect
  • Shaw Communications

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
Hi,

We have a modified Edit All for our Opportunity Products.  There is a column on the Edit All page that contains a number of dropdown fields that are the configuration for the Product on that line.  We dynamically assign the Field Set to the product and display the config fields for it.  This all displays fine and the dropdowns work for the user.  However, when we save it will use the last fieldset as a template for saving.

For example:

Product 1 has Config A, B & C
Product 2 has Config B & C

When saved Product 2 saves fine.
Product 1 saves Config A into B and Config B in C and discards Config C altogether.

This makes sense as the last field set the page knows about is Product 2's.  Has anyone run into this and gotten it to remember Product 1's FieldSet so it binds the values to the correct field?

Here is the code we are using to display the code in a single column of the Edit All table:

<apex:repeat value="{!$ObjectType.OpportunityLineItem.FieldSets[layout]}"  var="f" >
                        <div style="margin-bottom:1em">
                        <span id="myLabel" class="label" style="align:left"> {!f.fieldPath} </span>
                        <apex:inputField value="{!oppLItem[f]}" required="{!OR(f.required, f.dbrequired)}" onchange="foo(this);"/><br/>
                          </div>
</apex:repeat>

Thanks!
Lee
This link:
https://help.salesforce.com/apex/HTViewSolution?urlname=Spring-15-Access-Address-and-Geolocation-Compound-Fields-Using-Apex&language=en_US

says I can access Address compound fields from Apex.  I can access Account address fields but on Leads I get the error "Invalid field Address for SObject Lead".  This error when my trigger runs.  There is no error in the Developer console.  Not sure if this is by design or if I amdoing something wrong.  

I have tried just referencing the field, assigning the field to an Address type field, and looking it up in a SOQL query.  I can look the field up in the Execute Anonymous console and it works fine.

Any idea what I am doing wrong?  

Thanks!!
Hi,

We have a modified Edit All for our Opportunity Products.  There is a column on the Edit All page that contains a number of dropdown fields that are the configuration for the Product on that line.  We dynamically assign the Field Set to the product and display the config fields for it.  This all displays fine and the dropdowns work for the user.  However, when we save it will use the last fieldset as a template for saving.

For example:

Product 1 has Config A, B & C
Product 2 has Config B & C

When saved Product 2 saves fine.
Product 1 saves Config A into B and Config B in C and discards Config C altogether.

This makes sense as the last field set the page knows about is Product 2's.  Has anyone run into this and gotten it to remember Product 1's FieldSet so it binds the values to the correct field?

Here is the code we are using to display the code in a single column of the Edit All table:

<apex:repeat value="{!$ObjectType.OpportunityLineItem.FieldSets[layout]}"  var="f" >
                        <div style="margin-bottom:1em">
                        <span id="myLabel" class="label" style="align:left"> {!f.fieldPath} </span>
                        <apex:inputField value="{!oppLItem[f]}" required="{!OR(f.required, f.dbrequired)}" onchange="foo(this);"/><br/>
                          </div>
</apex:repeat>

Thanks!
Lee
This link:
https://help.salesforce.com/apex/HTViewSolution?urlname=Spring-15-Access-Address-and-Geolocation-Compound-Fields-Using-Apex&language=en_US

says I can access Address compound fields from Apex.  I can access Account address fields but on Leads I get the error "Invalid field Address for SObject Lead".  This error when my trigger runs.  There is no error in the Developer console.  Not sure if this is by design or if I amdoing something wrong.  

I have tried just referencing the field, assigning the field to an Address type field, and looking it up in a SOQL query.  I can look the field up in the Execute Anonymous console and it works fine.

Any idea what I am doing wrong?  

Thanks!!