• Tyler Zika
  • NEWBIE
  • 79 Points
  • Member since 2015
  • Developer
  • Touchpoint Solutions

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 18
    Questions
  • 26
    Replies
I've been given a requiremnet to go through an entirely custom built app that I didn't code and comment all the code. This app has 52 apex classes, 6 triggers, and 9 visualforce pages made with JavavScript. I've only been working with VF/Apex for a couple months, so this seems a bit overwhelming. Does anyone have any tips on how to effectively complete this requirement?
An internal server error has occurred Error ID: 1205720554-53597 (408822391)

I used to be able to create new items, but I can't anymore. Here is my code.
 
// get item created from form
var whiteboardItem = component.get("v.newWhiteboardItem");

// get server function to create new item   
var action = component.get("c.newWhiteboardItemDB");


    component.set("v.newWhiteboardItem.TouchpointDev__PersonalItem__c", component.get("v.personal"));

    // send item from form to server
    action.setParams({ "whiteboardItem" : whiteboardItem });
    action.setCallback(this, function(response) {
        var state = response.getState();
        if (component.isValid() && state === "SUCCESS") {
            console.log("Whiteboard item successfully saved");

            // get application event and send it to do list
            var newWhiteboardItemEvent = $A.get("e.TouchpointDev:AddToWhiteboardItemList");                
            newWhiteboardItemEvent.setParams({"whiteboardItem" : response.getReturnValue(), "personal" : component.get('v.personal'), "completed" : component.get('v.completed')}).fire();
        } else if (state === "ERROR") {
            var errors = response.getError();
            if (errors) {
                if (errors[0] && errors[0].message) {

                    // THIS is the line that prints the error.

                    console.log("Error message: " + errors[0].message);
                }
            } else {
                console.log("Unknown error");
            }
        } else {
            console.log("Action state returned was:" + state);
        }
    });
    $A.enqueueAction(action);

    // reset the form

    component.set("v.newWhiteboardItem",{ 'sobjectType': 'TouchpointDev__Whiteboard_Item__c',
                'Name': '',
                'TouchpointDev__Item_Due_Date__c': '',
                'TouchpointDev__AssignedTo__r.Name': '',
                'TouchpointDev__High_Priority__c': 'false',
                'TouchpointDev__PersonalItem__c' : 'true',
                'TouchpointDev__Completed__c' : 'false',
                'TouchpointDev__CompletedBy__r.Name' : '' 
              });
    }
},

 
Salesforce has a set functions that do a lot of basic web app functionality for you, called Event Reference. They can be found here https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_events.htm

On the editRecord Event Reference, found here
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_editRecord.htm

essentaily, I create a 
<ui:button label="Edit" press="{!c.editRecord}"/>

on my component, reference the attribute on the page and add the function from the docs in the controller
    editRecord : function(component, event, helper) {
        var editRecordEvent = $A.get("e.force:editRecord");
        console.log("record id is: "component.get("v.item.Id"));
        console.log("editRecordEvent value is: "editRecordEvent);
        editRecordEvent.setParams({
            "recordId": component.get("v.item.Id")
        });
        editRecordEvent.fire();
   }
correct?

Here is the odd thing. From the console.logs, I get the record id, but the editRecordEvent returns undefined. What is going on? Is there something I need to reference in my component to use Event Reference?
 
I have a component, that based on a boolean, displays the proper records
<c:Items completed="false"/>
<c:Items completed="true"/>
I have a press lightning event that updates the record on the page.User-added image
When I refresh the page, the item goes to the completed list.
User-added image
How do I make this item go to the other component without refreshing the page? 
I have a form that you can create an item and assign the item to a user in an org. I want to display the user names in the inputSelect, but when the form creates the new item, saves the users Id
 
<div>
    	<h1>New Whiteboard Item</h1>
        <ui:inputText label="Name" aura:id="name" value="{!v.newWhiteboardItem.Name}" />
        <ui:inputDate label="Due Date" aura:id="ItemDueDate" displayDatePicker="true" value="{!v.newWhiteboardItem.TouchpointDev__Item_Due_Date__c}" />
        <ui:inputSelect label="Assign To" aura:id="ItemAssignTo" value="{!v.newWhiteboardItem.TouchpointDev__AssignedTo__c}" />
        <ui:inputCheckbox label="High Priority" aura:id="ItemHighPriority" value="{!v.newWhiteboardItem.TouchpointDev__High_Priority__c}" />
        <ui:button label="Save" press="{!c.newWhiteboardItem}" />
</div>

In the doInt function I have this
loadOrgUsers : function(component) {
        var orgUsersDB = component.get("c.getUsersDB");
        orgUsersDB.setCallback(this, function(response) {
        var state = response.getState();
        if(component.isValid() && state == "SUCCESS") {
            console.log(response.getReturnValue());
            component.find("ItemAssignTo").set("v.options", response.getReturnValue());
        }
    });
    $A.enqueueAction(orgUsersDB);
},
The console.log returns an array of objects the the users Id and Name. The picklist is blank, but there are 4 blank rows, so it looks like I need to choose whether to display the user name or id, obviously the name. How do I do that?
 
I have a delete button. On the master object is works perfectly. Implmenting a slightly differnt code for the detail records, it acts differently.

Clicking delete on one item deletes it, but then the rest of detail items go blank. When I refresh the page, they blank items are populated, and the first item I deleted are no longer there.

Before clicking delete on sub item 1 - 0

User-added image
After clicking delete on sub item 1-0
User-added image
Refreshing the page.
User-added image
There is a form to create a new user for my customer portal. It creates a new contact when the form fills out. 

The problem. It doesn't collect the mobile # or the mailing addresss. It does first name, last name, email, and phone number. What could be wrong?
 
/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
public class CommunitiesSSignUpController {

    public String firstName {get; set;}
    public String lastName {get; set;}
    public String email {get; set;}
    public String password {get; set {password = value == null ? value : value.trim(); } }
    public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } }
    public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } }
    public String prefContactList { get; set; }
    public String mobilePhone { get; set; }
    public String homePhone { get; set; }
    public String mailingStreet { get; set; }
    public String mailingCity { get; set; }
    public String stateList { get; set; }
    public String mailingPostalCode { get; set; }
    public String Message {get; set; }
    public Boolean RegUserSuccessed { get; set; }

    
    public CommunitiesSSignUpController() {
        RegUserSuccessed=false;
    }
    
    public List<SelectOption> getStateCodes()
    {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = Contact.MailingStateCode.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for( Schema.PicklistEntry f : ple ) {
            options.add(new SelectOption(f.getLabel(), f.getValue()));

        }
        
        system.debug('*********'+options);
        return options;
    }
    
    public List<SelectOption> getPrefContact()
    {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = Contact.Preferred_Contact_Method__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for( Schema.PicklistEntry f : ple ) {
            options.add(new SelectOption(f.getLabel(), f.getValue()));

        }
        
        system.debug('*********'+options);
        return options;
    }    

    
    private boolean isValidPassword() {
        return password == confirmPassword;
    }

    public PageReference registerUser() {
        Boolean isEmailRegistered = false;
        List<User> users = [select Id from User where username = :email limit 1];
        if(users.size() > 0)
        {
            isEmailRegistered = true;
            Message = 'This email address already exists, click the Forgot Password link to generate a new password for it.';
             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, 'This email address already exists, click the Forgot Password link to generate a new password for it.');
            ApexPages.addMessage(msg);
        }
        if(!isEmailRegistered)
        {
           // it's okay if password is null - we'll send the user a random password in that case
            if (!isValidPassword()) {
                message = Label.site.passwords_dont_match;
                ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
                ApexPages.addMessage(msg);
                return null;
            }    
    
            String profileId = null; // To be filled in by customer.
            String roleEnum = null; // To be filled in by customer.
            String accountId = ''; // To be filled in by customer.
            
            String userName = email;
    
            User u = new User();
            u.Username = userName;
            u.Email = email;
            u.FirstName = firstName;
            u.LastName = lastName;
            u.Phone = homePhone;
            u.MobilePhone = mobilePhone;
            u.Street = mailingStreet;
            u.City = mailingCity;
            u.StateCode = stateList;
            u.PostalCode = mailingPostalCode;
            u.CommunityNickname = communityNickname;
    
            List<Account> communityAccts = [select Id from Account where Name = 'Community' limit 1];
            String communityAcctId = null;
            if(communityAccts.size() > 0)
            {
                communityAcctId = communityAccts[0].Id;
            }
            String userId = Site.createPortalUser(u, communityAcctId, null);
          system.debug('####' + userId);
            if (userId != null) { 
                RegUserSuccessed = true;
                Id cntId = [select ContactId from User where Id = :userId].COntactId;
                Id memberRecordTypeId = [select Id from RecordType where Name = 'Golden Opportunity' and sObjectType='COntact' limit 1].Id;
                COntact cnt = [select Preferred_Contact_Method__c, Phone, MobilePhone, MailingStreet, MailingCity, MailingStateCode, MailingPostalCode, RecordTypeId from Contact where id = :cntId];
                cnt.Preferred_Contact_Method__c = prefContactList;
                cnt.Phone = homePhone;
                cnt.MobilePhone = mobilePhone;
                cnt.MailingStreet = mailingStreet;
                cnt.MailingCity = mailingCity;
                cnt.MailingStateCode = stateList;
                cnt.MailingPostalCode = MailingPostalCode;
                cnt.RecordTypeId = memberRecordTypeId;
                
                update cnt;
                
                if (password != null && password.length() > 1) {
                    return Site.login(userName, password, ApexPages.currentPage().getParameters().get('startURL'));
                }
            }
            else
            {
                RegUserSuccessed = false;
            }
            
        }
        return null;
    }
}

 
I currently have a Lightning that displays a list of custom Master object records. 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="ListWhiteboardItemsApexController">
    
    <aura:attribute name="whiteboardItems" type="Whiteboard_Item__c[]"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
        
    <aura:iteration items="{!v.whiteboardItems}" var="whiteboardItem">  
            <c:whiteboardItem whiteboardItem="{!whiteboardItem}" "/>
    </aura:iteration>
    
   
    
</aura:component>

Each master record has many detail records attached to it. Would I need to do a database call for all the detail records? How do I reference them in my code?

Here was was the relationship looks like in the schema
User-added image
I have a VF page with a custom controller. It has a sign up form to create a new contact. When I tried adding a picklist field for the MailingStateCode field, I was unsure how to get the prepopulated values. Do I make a setter and getter for it? If so how? If not, what shall I do?
<!--campingListItem.cmp-->
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c" required="true"/>

	<ui:outputText value="{!v.item.Name}" />
	<ui:outputCheckbox value="{!v.item.Packed__c}" />
	<ui:outputCurrency value="{!v.item.Price__c}" />
	<ui:outputNumber value="{!v.item.Quantity__c}" />
	<ui:button label="Packed!" press="{!c.packItem}"/>
	
</aura:component>
<!--campingListController.js-->
({
	packItem : function(component, event, helper) {
		var button = event.getSource().get("v.disabled");
		component.set("v.item.Packed__c", "true");
		component.set(button, "true");
	}
})
What am I doing wrong?

 
AuraError: null is not an object (evaluating 'target.childNodes')
Back story on my code.

I have a component that iterates over a list of objects. I have a form that creates a new record of the same object type. When I add a new record from the form, I want that new record to be on the list of iterated objects, without resfreshing the page.

Couldn't find anything online for a solution
I'm having a hard time making this documentation

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/apex_records_delete.htm

work for my Lightning app. In the tutorial it says "For example, you have a component that contains a sub-component that is iterated over to display the records. Your sub-component contains a button (1), which when pressed fires an event that’s handled by the container component (2), which deletes the record that’s clicked on." (emphasis added)

Going further... "In the container component, include a handler for the event. In this example, c:expenseList is the sub-component that displays records." (emphasis added)

Example code from docs
<aura:handler name="deleteExpenseItem" event="c:deleteExpenseItem" action="c:deleteEvent"/>
<aura:iteration items="{!v.expenses}" var="expense">
    <c:expenseList expense="{!expense}"/>
</aura:iteration>



My app doesn't have a sub-component that is iterated over. Here is how it's structured.
<aura:iteration items="{!v.items}" var="i">
        <aura:if isTrue="{!i.PersonalItem__c}">
        <aura:if isTrue="{!i.CreatedById == v.currentUserId}">
        <tr>
            <td><ui:inputCheckbox value="{!i.Completed__c}"/></td>
            <td><ui:outputText value="{!i.Name}"/></td>
            <td><ui:outputText value="{!i.AssignedTo__c}"/></td>
            <td><ui:outputText value="{!i.Item_Due_Date__c}"/></td>
            <td><ui:button label="High Priority"/></td>
            <td><ui:button label="Delete" press="{!c.delete}"/></td>
        </tr>
        </aura:if>
        </aura:if>
</aura:iteration>

Do I need to make my interation list a subcomponent in order to delete them on the list, or is there some other way?
I'm creating a to do list app that you can assign users to items you create.

The form to create the item is a custom object. The "Assign To" field is of type LookUp(User).

I know when the form loads it needs to load an aura:attribute with the list of users, then interate over ui:inputSelect field with the aura:attribute.

I want to display the Users names, in the ui:inputSelect, but don't I need to use the user's Id for the value, since the "Assign To" field is of type LookUp(User)?

I'm not sure how to display the User names, but assign the User's Id as the value in the custom object, item.

How do I do this? If someone can point me in the right direction I'd appreciate it!

Hello,

I'd like to design the front end of my app using the Lightning Design System framework before I hook it up to the backend of my salesforce org. I downloaded the resources from https://www.lightningdesignsystem.com. This is the resources I have connect to my index.html

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

  <head>
    <title>Project Name</title>
    <link rel="stylesheet" href="assets/styles/salesforce-lightning-design-system.css">
  </head>

It appears that some resources are not showing up when implement the code, such as SVGs and modals not hiding when I set 
aria-hidden="true"

What others resources would I need to manually include in the index.html file?
Hello,

From this documentation https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Schema_PicklistEntry.htm#apex_Schema_PicklistEntry_getLabel

I see how how to return values from a custom picklist value. I've implented to code in my Visualforce controller like so.
 
public List<PicklistEntry> transportation
{
        get
        {
          Schema.DescribeFieldResult F = GO_Event__c.Transportation__c.getDescribe();
          List<Schema.PicklistEntry> P = F.getPicklistValues();
          
          return P;
        }
}


The problem is it's returning all the values instead and other code instead of just the one selected value in the record. Here is the Visualforce code

<li>{!transportation}</li>
and a screen shot of the output on the page.
User-added image

How to I get the one selected picklist value?
Hello, 

I'm accessing Salesforce record data with remote javascript.

This tutorial introduces doing this.

https://developer.salesforce.com/trailhead/en/lightning_design_system/lightning-design-system4

Have a custom fields: due date, complete date, completed by, and assigned to.

When I access these fields with remote objects, they return in a format I don't want displayed.

For example, due date returns: Sat Jan 25 2014 00:00:00 GMT-0800 (PST). I want it to display 01/25/2014
Assigned To return the user id: 005d0000000xlRkAAI. I want it ti display the users first and last name.

How do I do this? This is pure JavaScript, so do I use JavaScript or is there a way to embed Apex in my JS script?
I want to add style to the output of a Visualforce IF statement.
 
<li>{! IF( ISBLANK(GoEvent.Event_Time_End__c), '', "End Time: "+GoEvent.Event_Time_End__c+"" ) }</li>

How would I add bold tags to End Time: (<b>End Time: </b>) ?

When I do add bold tags in the if statement it takes them as a string and doesn't style it as bold.
Hello,

I'm able to pass the Trailhead, but I don't think it's importing properly cause I can't view the data anywhere. Should I be able to view the data?

Link to Trailhead - https://developer.salesforce.com/trailhead/force_com_dev_beginner/data_management/data_import
<!--campingListItem.cmp-->
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c" required="true"/>

	<ui:outputText value="{!v.item.Name}" />
	<ui:outputCheckbox value="{!v.item.Packed__c}" />
	<ui:outputCurrency value="{!v.item.Price__c}" />
	<ui:outputNumber value="{!v.item.Quantity__c}" />
	<ui:button label="Packed!" press="{!c.packItem}"/>
	
</aura:component>
<!--campingListController.js-->
({
	packItem : function(component, event, helper) {
		var button = event.getSource().get("v.disabled");
		component.set("v.item.Packed__c", "true");
		component.set(button, "true");
	}
})
What am I doing wrong?

 
Salesforce has a set functions that do a lot of basic web app functionality for you, called Event Reference. They can be found here https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_events.htm

On the editRecord Event Reference, found here
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/ref_force_editRecord.htm

essentaily, I create a 
<ui:button label="Edit" press="{!c.editRecord}"/>

on my component, reference the attribute on the page and add the function from the docs in the controller
    editRecord : function(component, event, helper) {
        var editRecordEvent = $A.get("e.force:editRecord");
        console.log("record id is: "component.get("v.item.Id"));
        console.log("editRecordEvent value is: "editRecordEvent);
        editRecordEvent.setParams({
            "recordId": component.get("v.item.Id")
        });
        editRecordEvent.fire();
   }
correct?

Here is the odd thing. From the console.logs, I get the record id, but the editRecordEvent returns undefined. What is going on? Is there something I need to reference in my component to use Event Reference?
 
I have a component, that based on a boolean, displays the proper records
<c:Items completed="false"/>
<c:Items completed="true"/>
I have a press lightning event that updates the record on the page.User-added image
When I refresh the page, the item goes to the completed list.
User-added image
How do I make this item go to the other component without refreshing the page? 
I have a delete button. On the master object is works perfectly. Implmenting a slightly differnt code for the detail records, it acts differently.

Clicking delete on one item deletes it, but then the rest of detail items go blank. When I refresh the page, they blank items are populated, and the first item I deleted are no longer there.

Before clicking delete on sub item 1 - 0

User-added image
After clicking delete on sub item 1-0
User-added image
Refreshing the page.
User-added image
There is a form to create a new user for my customer portal. It creates a new contact when the form fills out. 

The problem. It doesn't collect the mobile # or the mailing addresss. It does first name, last name, email, and phone number. What could be wrong?
 
/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
public class CommunitiesSSignUpController {

    public String firstName {get; set;}
    public String lastName {get; set;}
    public String email {get; set;}
    public String password {get; set {password = value == null ? value : value.trim(); } }
    public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } }
    public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } }
    public String prefContactList { get; set; }
    public String mobilePhone { get; set; }
    public String homePhone { get; set; }
    public String mailingStreet { get; set; }
    public String mailingCity { get; set; }
    public String stateList { get; set; }
    public String mailingPostalCode { get; set; }
    public String Message {get; set; }
    public Boolean RegUserSuccessed { get; set; }

    
    public CommunitiesSSignUpController() {
        RegUserSuccessed=false;
    }
    
    public List<SelectOption> getStateCodes()
    {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = Contact.MailingStateCode.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for( Schema.PicklistEntry f : ple ) {
            options.add(new SelectOption(f.getLabel(), f.getValue()));

        }
        
        system.debug('*********'+options);
        return options;
    }
    
    public List<SelectOption> getPrefContact()
    {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = Contact.Preferred_Contact_Method__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();

        for( Schema.PicklistEntry f : ple ) {
            options.add(new SelectOption(f.getLabel(), f.getValue()));

        }
        
        system.debug('*********'+options);
        return options;
    }    

    
    private boolean isValidPassword() {
        return password == confirmPassword;
    }

    public PageReference registerUser() {
        Boolean isEmailRegistered = false;
        List<User> users = [select Id from User where username = :email limit 1];
        if(users.size() > 0)
        {
            isEmailRegistered = true;
            Message = 'This email address already exists, click the Forgot Password link to generate a new password for it.';
             ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, 'This email address already exists, click the Forgot Password link to generate a new password for it.');
            ApexPages.addMessage(msg);
        }
        if(!isEmailRegistered)
        {
           // it's okay if password is null - we'll send the user a random password in that case
            if (!isValidPassword()) {
                message = Label.site.passwords_dont_match;
                ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
                ApexPages.addMessage(msg);
                return null;
            }    
    
            String profileId = null; // To be filled in by customer.
            String roleEnum = null; // To be filled in by customer.
            String accountId = ''; // To be filled in by customer.
            
            String userName = email;
    
            User u = new User();
            u.Username = userName;
            u.Email = email;
            u.FirstName = firstName;
            u.LastName = lastName;
            u.Phone = homePhone;
            u.MobilePhone = mobilePhone;
            u.Street = mailingStreet;
            u.City = mailingCity;
            u.StateCode = stateList;
            u.PostalCode = mailingPostalCode;
            u.CommunityNickname = communityNickname;
    
            List<Account> communityAccts = [select Id from Account where Name = 'Community' limit 1];
            String communityAcctId = null;
            if(communityAccts.size() > 0)
            {
                communityAcctId = communityAccts[0].Id;
            }
            String userId = Site.createPortalUser(u, communityAcctId, null);
          system.debug('####' + userId);
            if (userId != null) { 
                RegUserSuccessed = true;
                Id cntId = [select ContactId from User where Id = :userId].COntactId;
                Id memberRecordTypeId = [select Id from RecordType where Name = 'Golden Opportunity' and sObjectType='COntact' limit 1].Id;
                COntact cnt = [select Preferred_Contact_Method__c, Phone, MobilePhone, MailingStreet, MailingCity, MailingStateCode, MailingPostalCode, RecordTypeId from Contact where id = :cntId];
                cnt.Preferred_Contact_Method__c = prefContactList;
                cnt.Phone = homePhone;
                cnt.MobilePhone = mobilePhone;
                cnt.MailingStreet = mailingStreet;
                cnt.MailingCity = mailingCity;
                cnt.MailingStateCode = stateList;
                cnt.MailingPostalCode = MailingPostalCode;
                cnt.RecordTypeId = memberRecordTypeId;
                
                update cnt;
                
                if (password != null && password.length() > 1) {
                    return Site.login(userName, password, ApexPages.currentPage().getParameters().get('startURL'));
                }
            }
            else
            {
                RegUserSuccessed = false;
            }
            
        }
        return null;
    }
}

 
I currently have a Lightning that displays a list of custom Master object records. 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="ListWhiteboardItemsApexController">
    
    <aura:attribute name="whiteboardItems" type="Whiteboard_Item__c[]"/>
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
        
    <aura:iteration items="{!v.whiteboardItems}" var="whiteboardItem">  
            <c:whiteboardItem whiteboardItem="{!whiteboardItem}" "/>
    </aura:iteration>
    
   
    
</aura:component>

Each master record has many detail records attached to it. Would I need to do a database call for all the detail records? How do I reference them in my code?

Here was was the relationship looks like in the schema
User-added image
I have a VF page with a custom controller. It has a sign up form to create a new contact. When I tried adding a picklist field for the MailingStateCode field, I was unsure how to get the prepopulated values. Do I make a setter and getter for it? If so how? If not, what shall I do?
<!--campingListItem.cmp-->
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c" required="true"/>

	<ui:outputText value="{!v.item.Name}" />
	<ui:outputCheckbox value="{!v.item.Packed__c}" />
	<ui:outputCurrency value="{!v.item.Price__c}" />
	<ui:outputNumber value="{!v.item.Quantity__c}" />
	<ui:button label="Packed!" press="{!c.packItem}"/>
	
</aura:component>
<!--campingListController.js-->
({
	packItem : function(component, event, helper) {
		var button = event.getSource().get("v.disabled");
		component.set("v.item.Packed__c", "true");
		component.set(button, "true");
	}
})
What am I doing wrong?

 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,
AuraError: null is not an object (evaluating 'target.childNodes')
Back story on my code.

I have a component that iterates over a list of objects. I have a form that creates a new record of the same object type. When I add a new record from the form, I want that new record to be on the list of iterated objects, without resfreshing the page.

Couldn't find anything online for a solution

Hello,

I'd like to design the front end of my app using the Lightning Design System framework before I hook it up to the backend of my salesforce org. I downloaded the resources from https://www.lightningdesignsystem.com. This is the resources I have connect to my index.html

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

  <head>
    <title>Project Name</title>
    <link rel="stylesheet" href="assets/styles/salesforce-lightning-design-system.css">
  </head>

It appears that some resources are not showing up when implement the code, such as SVGs and modals not hiding when I set 
aria-hidden="true"

What others resources would I need to manually include in the index.html file?
Hello,

From this documentation https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Schema_PicklistEntry.htm#apex_Schema_PicklistEntry_getLabel

I see how how to return values from a custom picklist value. I've implented to code in my Visualforce controller like so.
 
public List<PicklistEntry> transportation
{
        get
        {
          Schema.DescribeFieldResult F = GO_Event__c.Transportation__c.getDescribe();
          List<Schema.PicklistEntry> P = F.getPicklistValues();
          
          return P;
        }
}


The problem is it's returning all the values instead and other code instead of just the one selected value in the record. Here is the Visualforce code

<li>{!transportation}</li>
and a screen shot of the output on the page.
User-added image

How to I get the one selected picklist value?
Developer Intermediate > Lightning Components > Using JavaScript Controllers With Components

Here is the Component:

<aura:component >
    <aura:attribute name="total" type="Integer" default="0"/>
    <ui:inputNumber aura:id="inputOne" label="Enter 1"/>
    <ui:inputNumber aura:id="inputTwo" label="Enter 2"/>
    <ui:inputNumber aura:id="inputThree" label="Enter 3"/>
    
    <ui:button label="Submit" press="{!c.calculate}"/>
    <ui:outputNumber aura:id="totalValue" value="{!v.total}"/>
</aura:component>

Here is the Controller:

({
    calculate : function(component, event, helper) {
        var inputOne = parseInt(component.find("inputOne").get("v.value"));

        var inputTwo = parseInt(component.find("inputTwo").get("v.value"));
        var inputThree = parseInt(component.find("inputThree").get("v.value"));
        var total = inputOne + inputTwo - inputThree;
        if (isNaN(total)){
            component.set("v.errors", [{message:"Total not a number: " + total}]);
        } else {
            component.set("v.total", total);
        }
    }
})

The error it gives me is "Challenge Not yet complete... here's what's wrong: 
The client side controller does not set a value for the outputNumber component".... BUT based on when I plig this into an app and run it, it sure appeas that the value for outputNumber is being set.

Any help would be appreciated.
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,