• Kashona Dotson
  • NEWBIE
  • 15 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 15
    Replies
It seems as though all of the custom actions are locked down. How can I change the fields shown and allow guest unauthenticated users to see Resources' pictures?  Does this have to be a completely new custom screen element?

User-added image
I have a visualforce page referencing a standard controller and extension. On the extension controller, I have three lists. How do I reference the lists in my visualforce page so that I can display fields that the extension has queried? Do I need an additional variable in my page attributes? If so, how do I write it?
Need to allow an unauthenticated guest user to access an inbound flow to facilitate Lightning Scheduler. When navigating to the community page as a guest, I always encounter an error and the flow component does not show. Required objects are granted read only access via sharing rules, as they are not listed on the community's guest profile. Community is build-your-own theme.
I have a component that allows users to update a picklist value on all child records from the parent record page. They are able to change the picklist values, but it won't save them to the child records.
component
<lightning:card iconName="custom:custom41" title="{! 'Item List for ' + v.RIM__c.Customer_Name__c}">     

<div class="slds-form slds-p-horizontal_medium" role="list">
<div class="slds-form__row"><div class="slds-form__item" role="listitem">
<div class="slds-form-element slds-form-element_horizontal slds-is-editing">    
      <lightning:select name="selectItem" label="Apply Decision to Selected:" value="{!v.selectedDecision}" onchange="{!c.setDcn}">
               <option text="None" value="{!v.value}"></option>
               <aura:iteration items="{!v.itemDecisionList}" var="stat">
                     <option text="{!stat}" value="{!stat}"></option>                    
               </aura:iteration>                    
       </lightning:select>
</div></div></div></div>  <!-- BEGIN TABLE JUNK -->

    <table class="slds-table">
        <thead>
            <tr class="slds-text-title_caps slds-line-height_reset">
                <th class="" style="width:10px">
                    <ui:inputCheckbox aura:id="box3" value="{!v.selectAll}" change="{!c.onCheck}"/></th>
                <th class="slds-p-around_xxx-small" scope="col"><div class="" title="Type">Type</div></th> 
                <th class="slds-p-around_xxx-small" scope="col"><div class="" title="Transaction Amount">Amount</div></th>               
                <th class="slds-p-around_xxx-small" scope="col"><div class="" title="Decision">Decision</div></th>
            </tr>
        </thead>
        <tbody>

<aura:iteration items="{!v.relatedItems}" var="itm">
<tr>
    <td><div class="" style="width:10px">
        <ui:inputCheckbox aura:id="boxPack" value="{!itm.itemSelected}"/></div>
    </td>

    <td data-label="Type">
    <div class="slds-form-element__control" title="Type">
        <p class="slds-text-body_regular">{!itm.wrapItem.Transaction_Type__c}</p>
    </div></td>

    <td data-label="Transaction Amount">
    <div class="slds-form-element__control" title="Transaction Amount">
           <p><lightning:formattedNumber value="{!itm.wrapItem.Transaction_Amount_Detail__c}" style="currency" currencyCode="USD"/></p>
    </div></td>             

    <td data-label="Decision">
        <ui:inputSelect  class="slds-select spear-select" aura:id="selectItem" value="{!itm.wrapItem.Decision__c}" updateOn="change" >    
            <aura:iteration items="{!v.itemDecisionList}" var="stat">
                <ui:inputSelectOption text="{!stat}" label="{!stat}" value="{!stat==itm.wrapItem.Decision__c}" />            
            </aura:iteration>    
        </ui:inputSelect>
<!-- aura:if isTrue="{!itm.wrapItem.Status__c == ''}"><img src="https://spectatorblogs.imgix.net/files/2016/03/ex.jpg"/>
    </aura:if-->&nbsp;
    </td>               
</tr></aura:iteration></tbody><br/> </table>    <!--BEGIN BUTTONS-->

            <div align="center">
                <lightning:button variant="neutral" label="Nvm" onclick="{!c.cancel}" />
                <lightning:button variant="brand" label="GO!" onclick="{!c.changeDcn}" /> 
            </div>

    </lightning:card>
</aura:component>
controller.js
({
    doInit : function(component, event, helper) {
        var action = component.get("c.getAllRelatedItems");  
        action.setParams({
            "visitRecordId" : component.get("v.recordId")});
        action.setCallback(this, function(a) {            
            component.set("v.relatedItems", a.getReturnValue());});
        $A.enqueueAction(action); 
        helper.getPrepopulatedValues(component, event, helper);},

    onCheck : function(component, event, helper) {
        var selAll = component.get("v.selectAll");
        var newlst =[];    
        var allItems = component.get("v.relatedItems");
        for(var i in allItems){
            var space = allItems[i];                    
            space.itemSelected = selAll;             
            newlst.push(space);}
        component.set("v.selectedItems",newlst);
        component.set("v.relatedItems",newlst);},

    setDcn : function(component, event, helper) {
        var selcDcn = component.get("v.selectedDecision");
        var newlst =[];    
        var allItems = component.get("v.relatedItems");
        for(var i in allItems){
            var space = allItems[i];                    
            if(space.itemSelected === true){
                space.wrapItem.Decision__c = selcDcn;}
            newlst.push(space);}
        component.set("v.relatedItems",newlst);}, 
//please help! ======================================================
    changeDcn : function(component, event, helper) {
        var allItems = component.get("v.relatedItems");
        for(var i in allItems){
            var space = allItems[i];    
            //alert("Decision: " + space.wrapItem.Decision__c);
        }

        var action = component.get("c.saveDcn");
        action.setParams({"dcns": allItems});
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                var listy = component.get("v.itemDecisionList");
                listy.push(response.getReturnValue());
                component.set("v.itemDecisionList", listy);
            }
        });
        $A.enqueueAction(action);


    }, 
//===================================================================    
    cancel : function (component, event, helper) {
        var action = component.get("c.getAllRelatedItems");  
        action.setParams({
            "visitRecordId" : component.get("v.recordId")});
        action.setCallback(this, function(a) {            
            component.set("v.relatedItems", a.getReturnValue());});
        $A.enqueueAction(action); 
        helper.getPrepopulatedValues(component, event, helper);
    },
})
controller.apxc
public class MassUpdateController {
    @auraEnabled
    public static List<wrapItemRecord> getAllRelatedItems(Id visitRecordId){
        List<wrapItemRecord> wrapItemRecordList = new List<wrapItemRecord>();
        for(RIM_Item__c itm : [select Id, Name, RIM__r.Name, Decision__c, Transaction_Amount_Detail__c, 
                               Transaction_Type__c, RIM__r.Customer_Name__c 
                               from RIM_Item__c where RIM__c = :visitRecordId]){
            wrapItemRecordList.add(new wrapItemRecord(itm));
        }
        return wrapItemRecordList;
    }
    @auraEnabled
    public static List<String> getDcnValues(){
        List<String> options = new List<String>();
        Schema.DescribeFieldResult fieldResult = RIM_Item__c.Decision__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for (Schema.PicklistEntry f: ple) {
            options.add(f.getLabel());
        }
        return options;
    }
    //==================================================================
    @auraEnabled
    public static RIM_Item__c saveDcn(RIM_Item__c dcns){
        UPDATE dcns;
        RETURN dcns;
    }
    //==================================================================

    public class wrapItemRecord{
        @auraEnabled
        public boolean itemSelected{get; set;}

        @auraEnabled
        public RIM_Item__c wrapItem{get; set;}

        @auraEnabled
        public boolean isDecided{get; set;}

        public wrapItemRecord(RIM_Item__c itm){
            itemSelected = false;
            wrapItem = itm;
            if(itm.Decision__c == null){
                isDecided = false;
            }else{
                isDecided = true;
            }
        }
    }
}


helper
({
        getPrepopulatedValues : function(component, event, helper) {
            var action = component.get("c.getDcnValues");
            action.setCallback(this, function(a) {            
                component.set("v.itemDecisionList", a.getReturnValue());
            });
            $A.enqueueAction(action);
        },
    })

**controller.apxc**:
public class MassUpdateController {
    @auraEnabled
    public static List<wrapItemRecord> getAllRelatedItems(Id visitRecordId){
        List<wrapItemRecord> wrapItemRecordList = new List<wrapItemRecord>();
        for(RIM_Item__c itm : [select Id, Name, RIM__r.Name, Decision__c, Transaction_Amount_Detail__c, 
                               Transaction_Type__c, RIM__r.Customer_Name__c 
                               from RIM_Item__c where RIM__c = :visitRecordId]){
            wrapItemRecordList.add(new wrapItemRecord(itm));
        }
        return wrapItemRecordList;
    }
    @auraEnabled
    public static List<String> getDcnValues(){
        List<String> options = new List<String>();
        Schema.DescribeFieldResult fieldResult = RIM_Item__c.Decision__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for (Schema.PicklistEntry f: ple) {
            options.add(f.getLabel());
        }
        return options;
    }
    //==================================================================
    @auraEnabled
    public static RIM_Item__c saveDcn(RIM_Item__c dcns){
        UPDATE dcns;
        RETURN dcns;
    }
    //==================================================================

    public class wrapItemRecord{
        @auraEnabled
        public boolean itemSelected{get; set;}

        @auraEnabled
        public RIM_Item__c wrapItem{get; set;}

        @auraEnabled
        public boolean isDecided{get; set;}

        public wrapItemRecord(RIM_Item__c itm){
            itemSelected = false;
            wrapItem = itm;
            if(itm.Decision__c == null){
                isDecided = false;
            }else{
                isDecided = true;
            }
        }
    }
}

 
Uncaught Error in $A.getCallback() [items.push is not a function]
Callback failed: apex://MassUpdateController/ACTION$saaave

cmp
<lightning:button variant="brand" label="Save" onclick="{!c.saveTable}" />
controller.js
saveTable : function(component, event, helper) {   
        var action = component.get("c.saaave");
        var items = component.get("v.selectedStatus");
        var atd = component.get("v.relatedAttendees");
        action.setParams({"v.selectedStatus": JSON.stringify(items)});
        action.setCallback(this, function(data){
            var state = data.getState();
            if (component.isValid() && state === "SUCCESS") {
                items.push(data.getReturnValue());
                component.set("v.selectedStatus", atd);
            }
        });
        $A.enqueueAction(action);
    },


controller.apxc
@AuraEnabled
        public static void saaave(){
            list<RIM_Item__c> ple = new list<RIM_Item__c>();
            ple = [select id, Decision__c from RIM_Item__c];
            RIM_Item__c itms = new RIM_Item__c();
            itms.id=ple[0].id;
            update itms;
        }




 
I'm getting this error from the following second-to-last line
RIM__c.name is an autonumber field; but when I try to run this test it is failing due to a required field not being completed. The RIM_Item.RIM__c field is required and I had it pulling the RIM__c id, then realized that it should be the value from the RIM__c.name field....
 
RIM__c  rtm = new RIM__c ();
rtm.Customer_Name__c ='Test' ; 
rtm.Available_Account_Balance__c = 100 ;
insert rtm ;
    
        
RIM_Item__c item = new RIM_Item__c(); 
item.Item_Purpose__c = 'Test' ; 
item.Transaction_Type__c = 'Check' ;
item.Transaction_Amount_Detail__c = 500 ;
item.RIM__c = [select name from RIM__c where id = :rtm.id] ;
    
insert item ;

 
I have this Apex Class and my visualforce page and they work beautifully but I need to get 75% test coverage! My brain is mush, I don't even know where to start...
 
public class multiAddRIM {
    
    List <RIM_Item__c> RIMitemList;
      public Id rID = ApexPages.currentPage().getParameters().get('Id');
      public Id getID {get; set;}
    
    public PageReference reset() {
      RIMitemList = [select name, RIM__c, Transaction_Type__c, Check_Number__c, Transaction_Amount_Detail__c, 
                     Fee_Detail__c, Decision__c from RIM_Item__c where RIM__c =: rID ];
      return null; }
    
    public List <RIM_Item__c> getRIMitems() {
      if(RIMitemList == null) reset();
      return RIMitemList;}
    
    public void setAccounts(List <RIM_Item__c> items) {
      RIMitemList = items;}
    
    public PageReference save() {//upsert records on save
      upsert RIMitemList;
      ApexPages.Message myMsg = new ApexPages.message(ApexPages.Severity.Info, 'Records Saved Successfully'); //show confirmation message on save
      ApexPages.addMessage(myMsg);
      return null;}
    
    public PageReference add() {
      RIMitemList.add(New RIM_Item__c(RIM__c = rID)); //add records to RIM Item and associate with current RIM Record
      return null; }
}

 
GOAL: Create a vfp+apxc combo to make a button on a custom Parent Object that will allow a user to edit and create new items on a related list.
 
public class RimItemEditExtension {
 
    private ApexPages.StandardController std;
         
    public List<RIM_Item__c> items; // the associated rim ITEMS          
        
    public Id chosenITEMSId {get; set;} // the chosen rim item id - used when deleting an item
    public String newITEMStype {get; set;} 
    // addmore=public String newITEMSLastName {get; set;} 
	    
    public RimItemEditExtension() {}
     
    public RimItemEditExtension(ApexPages.StandardController stdCtrl) 
    	{
     	std=stdCtrl;
    	}
     
    public RIM__c getRIM() //RIM getRIM
    	{
     	return (RIM__c) std.getRecord();
    	}
 
 	public SObject getSobject()
 		{
  		return std.getRecord();
 		}
      
    private boolean updateITEMS()
    	{
        boolean result=true;
        if (null!=ITEMS)
           {
              // TODO: should work out what's changed and then save, easier to update everything for prototype
            List<RIM_Item__c> updateITEMS=new List<RIM_Item__c>();
            try
              {
               update ITEMS;
              }
              catch (Exception e)
              {
                 String msg=e.getMessage();
                 integer pos;
                  
                 // if its field validation, this will be added to the messages by default
                 if (-1==(pos=msg.indexOf('FIELD_CUSTOM_VALIDATION_EXCEPTION, ')))
                 {
                    ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, msg));
                 }
                  
                 result=false;
              }
           }
            
           return result;
    }
     
    public PageReference saveAndExit()
    {
     boolean result=true;
    result=updateITEMS();
      
     if (result)
     {
        // call standard controller save
        return std.save();
     }
     else
     {
      return null;
     }
    }
     
    public PageReference save()
    {
     Boolean result=true;
     PageReference pr=Page.RimItemsEdit;
     if (null!=getRIM().id)
     {
      result=updateITEMS();
     }
     else
     {
      pr.setRedirect(true);
     }
      
     if (result)
     {
        // call standard controller save, but don't capture the return value which will redirect to view page
        std.save();
           ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Changes saved, click Back to return to main file'));
     }
        pr.getParameters().put('id', getRIM().id);
      
     return pr;
    }
 
    public void newITEMS()
    {
       if (updateITEMS())
       {
          RIM_Item__c i=new 
              RIM_Item__c(Transaction_Type__c=newitemstype, RIM__c=getRIM().id);
          insert i;
         
          newitemsType=null; 
          //newField=null;
          items=null;
       }
    }
     
    public void deleteITEMS()
    {
       if (updateITEMS())
       {
          if (null!=chosenITEMSId)
          {
             RIM_Item__c i=new RIM_Item__c(Id=chosenITEMSId);
              delete i;
        
              ITEMS=null;
              chosenITEMSId=null;
          }
       }
    }
     
   	public List<RIM_Item__c> getITEMS() //'List getITEMS'
    {
       if ( (null!=getRIM().id) && (ITEMS == null) )
       {
           ITEMS=[SELECT Id, Transaction_Type__c, Check_Number__c, Transaction_Amount_Detail__c, Fee_Detail__c,
                  Decision__c, Transaction_Amount_Decision__c, Fee_Decision__c, Item_Purpose__c, RIM__c
                         FROM RIM_Item__c 
                         WHERE RIM__c = : getRIM().ID
                         ORDER BY CreatedDate asc];
       } 
                           
       return ITEMS;
    }
}
<apex:page standardController="RIM__c"
           extensions="RimItemEditExtension" 
           tabStyle="RIM__c" title="RIM Item Edit" >
    <apex:pageMessages />
    <apex:form >
        <apex:pageBlock mode="mainDetail">
            
            <apex:pageBlockButtons location="top"> 
                <apex:commandButton action="{!cancel}" value="Back" />
                <apex:commandButton action="{!save}" value="Save" />
                <apex:commandButton action="{!newITEMS}" value="Add Item" rendered="{!NOT(ISBLANK(RIM.id))}" onclick="showpopup(); return false;"/>
            </apex:pageBlockButtons>
            
            
            <apex:pageBlockSection title="Main RIM File Details" collapsible="true" id="mainRecord" columns="2" >                          
            <apex:repeat value="{!$ObjectType.RIM__c.FieldSets.RIMListEdit}" var="field">
               <apex:inputField value="{!RIM__c.[field]}" />
            </apex:repeat>
            </apex:pageBlockSection>
            
           <apex:outputPanel id="ITEMS"> 
                <apex:repeat value="{!RIM_Item__c}" var="itemobj" >
                    <apex:pageBlockSection columns="1"  title="RIM Item {!ITEMobj.Name}" collapsible="true">
                        <apex:pageBlockSectionItem >
                              <apex:pageBlockSection columns="2">
                 <apex:repeat value="{!$ObjectType.ITEMobj.FieldSets.RIMItemListEdit}" var="field">
                     <apex:inputField value="{!ITEMobj[field]}" />
                 </apex:repeat>
                              </apex:pageBlockSection>
                        </apex:pageBlockSectionItem>
                    </apex:pageBlockSection>
                    
                       <div style="text-align:left">
                           <apex:commandButton value="Delete This Item" onclick="idToDelete='{!ITEMS.id}'; showpopup('deletecontent'); return false;"/>
                       </div>
                    
                </apex:repeat>
            </apex:outputPanel>
             
       </apex:pageBlock>
        
        
  <apex:outputPanel id="addPanel">
  <apex:actionRegion id="popupRegion">
   <div id="opaque"/>
      <div id="popupcontent" class="popupcontent" style="width: 250px; height: 100px;">
     Please enter the new RIM item details
 
     <apex:outputLabel value="Transaction Type: "/>
          <apex:inputField id="newitemsType" value="{!ITEMS.Transaction_Type__c}"/>
          
        <apex:commandButton id="cancelBtn" value="Cancel" onclick="hidepopup(); return false;"/>
       <apex:commandButton id="confirmBtn" action="{!newITEMS}" value="Create" rerender="itemsList, addPanel" onclick="hidepopup();" status="working"/>
      </div>
   </apex:actionRegion>
   </apex:outputPanel>
        
        
  <apex:actionRegion id="deleteRegion">
      <div id="deletecontent" class="popupcontent" style="width: 250px; height: 100px;">
     Are you sure you wish to delete RIM Item?
     
 
        <apex:commandButton id="cancelDelBtn" value="Cancel" onclick="hidepopup('deletecontent'); return false;"/>
       <apex:commandButton id="confirmDelBtn" value="Delete" rerender="itemsList" onclick="hidepopup('deletecontent'); alert('Deleting item ' + idToDelete); deleteITEMS(idToDelete); return false;" status="working"/>
      </div>
   </apex:actionRegion>
      <apex:actionFunction name="deleteITEMS" action="{!deleteITEMS}" rerender="contactList" status="working">
         <apex:param name="itemsIdent" value="" assignTo="{!chosenITEMSId}"/>
      </apex:actionFunction>
    </apex:form>        
    <div id="workingcontent" class="popupcontent" style="width:150px; height:50px; margin-top:-100px; marginleft:-100px">
        <p align="center" style='{font-family:"Arial", Helvetica, sans-serif; font-size:20px;}'><apex:image value="/img/loading.gif"/>&nbsp;Please wait</p>
   </div>
 
    <apex:actionStatus id="working" onstart="showpopup('workingcontent');" onstop="hidepopup('workingcontent');" />
  
    
    
	<script>
   		function showpopup(popupname)
   		{
      var name="popupcontent";
      if (popupname)
      {
         name=popupname;
      }
      var popUp = document.getElementById(name);
      popUp.style.display = "block";
      document.getElementById('opaque').style.display='block';
   }
    
   		function hidepopup(popupname)
   		{
      var name="popupcontent";
      if (popupname)
      {
         name=popupname;
      }
      var popUp = document.getElementById(name);
      popUp.style.display = "none";
      document.getElementById('opaque').style.display='none';
   }
    
   		var idToDelete;
    
	</script>

	<style>
  .popupcontent{
   position: fixed;
   top: 100%;
   left: 100%;
   margin-top: -100px;
   margin-left: -100px;
   display: none;
   overflow: auto;
   border:1px solid #CCC;
   background-color:white;
   border:3px solid #333;
   z-index:100;
   padding:5px;
   line-height:20px;
   font-size: 14px;
}
#opaque {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: none;
    background-color: gray;
    filter: alpha(opacity=30);
    opacity: 0.3;
    -moz-opacity:0.3;
    -khtml-opacity:0.3
}
* html #opaque {
    position: absolute;
}
  </style>
    
</apex:page>

Current error: Could not resolve field '[field]' from <apex:inputField> value binding '{!RIM__c.[field]}' in page RimItemsEdit

 
Need to allow an unauthenticated guest user to access an inbound flow to facilitate Lightning Scheduler. When navigating to the community page as a guest, I always encounter an error and the flow component does not show. Required objects are granted read only access via sharing rules, as they are not listed on the community's guest profile. Community is build-your-own theme.
It seems as though all of the custom actions are locked down. How can I change the fields shown and allow guest unauthenticated users to see Resources' pictures?  Does this have to be a completely new custom screen element?

User-added image
Need to allow an unauthenticated guest user to access an inbound flow to facilitate Lightning Scheduler. When navigating to the community page as a guest, I always encounter an error and the flow component does not show. Required objects are granted read only access via sharing rules, as they are not listed on the community's guest profile. Community is build-your-own theme.

I would like to know how much lightning scheduler cost? and how to enable it? I find the steps below. but there is not lightning scheduler app in app manager.

 

Assign the Lightning Scheduler Setup App
From Setup, in the Quick Find box, enter App Manager , and then select App Manager.
In Lightning Experience App Manager, click the Lightning Scheduler Setup dropdown and click Edit.
In App Settings, select User Profiles.
Move the System Administrator profile to Selected Profiles.
Save the changes.

Uncaught Error in $A.getCallback() [items.push is not a function]
Callback failed: apex://MassUpdateController/ACTION$saaave

cmp
<lightning:button variant="brand" label="Save" onclick="{!c.saveTable}" />
controller.js
saveTable : function(component, event, helper) {   
        var action = component.get("c.saaave");
        var items = component.get("v.selectedStatus");
        var atd = component.get("v.relatedAttendees");
        action.setParams({"v.selectedStatus": JSON.stringify(items)});
        action.setCallback(this, function(data){
            var state = data.getState();
            if (component.isValid() && state === "SUCCESS") {
                items.push(data.getReturnValue());
                component.set("v.selectedStatus", atd);
            }
        });
        $A.enqueueAction(action);
    },


controller.apxc
@AuraEnabled
        public static void saaave(){
            list<RIM_Item__c> ple = new list<RIM_Item__c>();
            ple = [select id, Decision__c from RIM_Item__c];
            RIM_Item__c itms = new RIM_Item__c();
            itms.id=ple[0].id;
            update itms;
        }




 
I had so much trouble with this one section that I feel like I have to post this to help out those who are struggling as much as me. Three hours for a simple controller... The problem is the way trailhead tests the challenge is hard for them and they have very strict criteria that is not implicit in the challenge directions.

camingList.cmp
<aura:component >
    
	<aura:attribute name="newItem" type="Camping_Item__c"  default="{'sobjectType': 'Camping_Item__c', 'Quantity__c': 0, 'Price__c': 0.00}" required="true"/>
	<aura:attribute name="items" type="Camping_Item__c[]"/>
	<lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="standard:scan_card" alternativeText="My Campign Items"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Camping Items</h1>
                <h2 class="slds-text-heading--medium">My Camping Items</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->

    <!-- NEW EXPENSE FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">

        <!-- CREATE NEW EXPENSE -->
    <div aria-labelledby="newitemform">

        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default slds-container--small">

        <legend id="newitemform" class="slds-text-heading--small 
          slds-p-vertical--medium">
          Add Camping Item
        </legend>
  
        <!-- CREATE NEW EXPENSE FORM -->
        <form class="slds-form--stacked">          
            <lightning:input aura:id="itemform" label="Item Name"
                             name="itemname"
                             value="{!v.newitem.Name}"
                             required="true"/> 
            <lightning:input type="itemform" aura:id="itemform" label="Amount"
                             name="itemprice"
                             min="0.1"
                             formatter="currency"
                             step="0.01"
                             value="{!v.newitem.Price__c}"
                             messageWhenRangeUnderflow="Enter an amount that's at least $0.10."/>
            <lightning:input aura:id="itemform" label="Quantity"
                             name="itemquantity"
                             value="{!v.newitem.Quantity__c}"
							 min="1"
							 type="number"
							 required="true"
							 messageWhenRangeUnderflow="Enter minimum 1 Quantity"/>
                             />
            <lightning:input type="checkbox" aura:id="itemform" label="Packed?"  
                             name="packed"
							 class="slds-checkbox"
                             checked="{!v.newitem.Packed__c}"/>
            <lightning:button label="Create Camping Item" 
                              class="slds-m-top--medium"
                              variant="brand"
                              onclick="{!c.clickCreateItem}"/>
        </form>
        <!-- / CREATE NEW EXPENSE FORM -->
  
      </fieldset>
      <!-- / BOXED AREA -->

    </div>
    <!-- / CREATE NEW EXPENSE -->

        </lightning:layoutItem>
    </lightning:layout>
    <!-- / NEW EXPENSE FORM -->
	
	<div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Camping</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="cmp">
                    <c:campingListItem item="{!cmp}"/>
                </aura:iteration>
            </div>
        </section>
	</div>
</aura:component>

campingList.Controller
({
		handleAddItem: function(component, event, helper) {
    var addItm = event.getParam("item");
    helper.createItem(component, addItm);

},

    createItem: function(component, newItem) {
    var action = component.get("c.clickCreateItem");
    action.setParams({
        "item": newItem
    });
    action.setCallback(this, function(response){
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            var items = component.get("v.items");
            items.push(response.getReturnValue());
            component.set("v.items", items);
        }
    });
    $A.enqueueAction(action);
},
    clickCreateItem: function(component, event, helper) {
		
        var validItem = component.find('itemform').reduce(function (validSoFar, inputCmp) {
            // Displays error messages for invalid fields
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && inputCmp.get('v.validity').valid;
        }, true);
        
        
        // ... hint: more error checking here ...

        // If we pass error checking, do some real work
        if(validItem){
            // Create the new expense
            var newItem = component.get("v.newItem");
            console.log("Create Camping Item: " + JSON.stringify(newCamping));
            handleAddItem(component, newItem);
        }
		component.set("v.newItem",{'sobjectType':'Camping_Item__c',
                'Name': '',
                'Quantity__c': 0,
                'Price__c': 0,
                'Packed__c': false});
    }
})
camping.cmp
<aura:component implements="flexipage:availableForRecordHome">
	<br/><br/><br/>
    <c:campingHeader />
    <c:campingList />
</aura:component>

campingHeader.cmp
<aura:component >
	<lightning:layout class="slds-page-header">
		<lightning:layoutItem >
			<lightning:icon iconName="action:goal"/>
		</lightning:layoutItem>

		<div class="slds-page-header">
			<h1 class="slds-text-heading--label"> Camping List </h1>
		</div>
	</lightning:layout>
</aura:component>

campingListItem.cmp
 
<aura:component >
    <aura:attribute name="item" type="Camping_Item__c"/>
    
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price:
        <ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed:
        <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
</aura:component>

Any other controllers or helper classes are not needed. That is the trick here. Using helper classes when not specified fails the challenge. I hope you will read through and understand this code as I have to realize why it is this way and not simply copypasta.

Enjoy!
 
I'm getting this error from the following second-to-last line
RIM__c.name is an autonumber field; but when I try to run this test it is failing due to a required field not being completed. The RIM_Item.RIM__c field is required and I had it pulling the RIM__c id, then realized that it should be the value from the RIM__c.name field....
 
RIM__c  rtm = new RIM__c ();
rtm.Customer_Name__c ='Test' ; 
rtm.Available_Account_Balance__c = 100 ;
insert rtm ;
    
        
RIM_Item__c item = new RIM_Item__c(); 
item.Item_Purpose__c = 'Test' ; 
item.Transaction_Type__c = 'Check' ;
item.Transaction_Amount_Detail__c = 500 ;
item.RIM__c = [select name from RIM__c where id = :rtm.id] ;
    
insert item ;

 
I have this Apex Class and my visualforce page and they work beautifully but I need to get 75% test coverage! My brain is mush, I don't even know where to start...
 
public class multiAddRIM {
    
    List <RIM_Item__c> RIMitemList;
      public Id rID = ApexPages.currentPage().getParameters().get('Id');
      public Id getID {get; set;}
    
    public PageReference reset() {
      RIMitemList = [select name, RIM__c, Transaction_Type__c, Check_Number__c, Transaction_Amount_Detail__c, 
                     Fee_Detail__c, Decision__c from RIM_Item__c where RIM__c =: rID ];
      return null; }
    
    public List <RIM_Item__c> getRIMitems() {
      if(RIMitemList == null) reset();
      return RIMitemList;}
    
    public void setAccounts(List <RIM_Item__c> items) {
      RIMitemList = items;}
    
    public PageReference save() {//upsert records on save
      upsert RIMitemList;
      ApexPages.Message myMsg = new ApexPages.message(ApexPages.Severity.Info, 'Records Saved Successfully'); //show confirmation message on save
      ApexPages.addMessage(myMsg);
      return null;}
    
    public PageReference add() {
      RIMitemList.add(New RIM_Item__c(RIM__c = rID)); //add records to RIM Item and associate with current RIM Record
      return null; }
}