• Josh Gruberman 12
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
This Trailhead: https://trailhead.salesforce.com/modules/data_security/units/data_security_objects says to remove all permissions except Read from Account, which I am trying to do but Contacts keeps automatically checking when I check Account permissions.  Is there something I'm missing?

I am having trouble wrapping my head around this so if someone could help me with a start to the code, I would be very grateful.  

I have a custom object called Inventory__c.  It has Year__c, Make__c, and Model__c custom fields and I want to display the Year, Make and Model for each record within the Inventory object in a grid layout similar to this: https://webtemplatemasters.com/screenshots/cardealer/wordpress-car-theme-search.jpg.

I'm going to theme it accordingly and do all the styles, but I can't seem to figure out how to get the records in that sort of grid layout.  I know I need a custom controller, but not sure how to write it or invoke it from the VF page. 

Any help would be great. thanks a lot

I'm brand new to classes and controllers so I'm sure this is an easy fix but I'm getting an error of "Unknown property 'InventoryController.Inventory__c".  I'm just trying to start with some simple code to make sure I know what I'm doing - clearly I don't :)  I started with a Snippet from the VF Dev Guide.  Anyone give me a hand with this?

Apex Class
public class InventoryController {

    private final Inventory__c inventory;

    public InventoryController() {
        Inventory = [SELECT Id, Name, Year__c, Make__c, Model__c, Description__c, Price__c FROM Inventory__c 
                   WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    }

    public Inventory__c getInventory() {
        return inventory;
    }

    public PageReference save() {
        update inventory;
        return null;
    }
}

Visualforce Page
<apex:page controller="InventoryController" sidebar="false" showHeader="false">
    <apex:form>
        <apex:pageBlock>
            Year: <apex:inputField value="{!Inventory__c.Year__c}"/>
            Make: <apex:inputField value="{!Inventory__c.Make__c}"/>
            Model: <apex:inputField value="{!Inventory__c.Model__c}"/>
            <apex:commandButton action="{!save}" value="save"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 
This Trailhead: https://trailhead.salesforce.com/modules/data_security/units/data_security_objects says to remove all permissions except Read from Account, which I am trying to do but Contacts keeps automatically checking when I check Account permissions.  Is there something I'm missing?

I am having trouble wrapping my head around this so if someone could help me with a start to the code, I would be very grateful.  

I have a custom object called Inventory__c.  It has Year__c, Make__c, and Model__c custom fields and I want to display the Year, Make and Model for each record within the Inventory object in a grid layout similar to this: https://webtemplatemasters.com/screenshots/cardealer/wordpress-car-theme-search.jpg.

I'm going to theme it accordingly and do all the styles, but I can't seem to figure out how to get the records in that sort of grid layout.  I know I need a custom controller, but not sure how to write it or invoke it from the VF page. 

Any help would be great. thanks a lot