• M Miller
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am working on a visualforce page with the Account standard controller, and am pulling in fields from the Account, Contact, and Opportunity objects with no problem. My problem is that I also need to show the associated Products, but I can't for the life of me figure out how to do this. The way I brought in contact and opportunity fields associated with an account (apex:pageblocktable value="{!Account.contacts}"  var="contact") isn't working for associated products. When I set up (apex:pageblocktable value="{!Account.products}"  var="product") or any variation like productitems or opportunityproducts, I get an error message of "Invalid field for sObject Account".

I'm really new to Visualforce, and am struggling to understand why this is such a problem! Is there any way to get the name of a product on my VF page?
I am working on a visualforce page with the Account standard controller, and am pulling in fields from the Account, Contact, and Opportunity objects with no problem. My problem is that I also need to show the associated Products, but I can't for the life of me figure out how to do this. The way I brought in contact and opportunity fields associated with an account (apex:pageblocktable value="{!Account.contacts}"  var="contact") isn't working for associated products. When I set up (apex:pageblocktable value="{!Account.products}"  var="product") or any variation like productitems or opportunityproducts, I get an error message of "Invalid field for sObject Account".

I'm really new to Visualforce, and am struggling to understand why this is such a problem! Is there any way to get the name of a product on my VF page?
I submitted my work and I received this error message. The challenge says nothing about adding a field with this name. 

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]