You need to sign in to do that
Don't have an account?
component attribute default sobjectType - can you use whatever name/value pairs you want?
Hello Salesforce experts,
I was going through my Salesforce Dev601 training manual from Developing Lightning Components. In the second chapter, there's this:
Thanks for helping.
I was going through my Salesforce Dev601 training manual from Developing Lightning Components. In the second chapter, there's this:
<aura:attribute name="student" type="Contact" access="public" default="{'sobjectType':'Contact','Name':'John Smith',PhotoUrl:'/services/images/photo/003B0000009VnYcIAK'}"/>Was just wondering how that works? Name and PhotoUrl are not fields in the Contact object, so can I define this student attribute default with any name/value pairs I want even though I define it as a type of Contact? So confused...
Thanks for helping.
Name is a special field (concatenation) and they exist both into the free developer orgs.
SOQL request works : select Name, PhotoUrl from contact
Name Type: string
Description: Concatenation of FirstName, MiddleName, LastName, and Suffix. Maximum size is 121 characters.
PhotoUrl Type: url
Description: Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the contact. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the contact.
Blank if Social Accounts and Contacts isn't enabled for the organization or if Social Accounts and Contacts is disabled for the requesting user.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm)
All Answers
Name is a special field (concatenation) and they exist both into the free developer orgs.
SOQL request works : select Name, PhotoUrl from contact
Name Type: string
Description: Concatenation of FirstName, MiddleName, LastName, and Suffix. Maximum size is 121 characters.
PhotoUrl Type: url
Description: Path to be combined with the URL of a Salesforce instance (for example, https://yourInstance.salesforce.com/) to generate a URL to request the social network profile image associated with the contact. Generated URL returns an HTTP redirect (code 302) to the social network profile image for the contact.
Blank if Social Accounts and Contacts isn't enabled for the organization or if Social Accounts and Contacts is disabled for the requesting user.
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm (https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contact.htm)