You need to sign in to do that
Don't have an account?
Tyler Zika
Format a remote object to display proper data
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'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?
The bad new, as of yet it seems you still cannot use relational fields in remote objects. That being said I did find an interim solution on salesforce stack exchange presented by Mohith Shrivastava. His idea is to create a formula field on the Account object that retrieves the fields you are looking for and then query for the formula field in the remote object. "CreatedBy.FirstName + ' ' +CreatedBy.LastName".
Hope this helps.
All Answers
The bad new, as of yet it seems you still cannot use relational fields in remote objects. That being said I did find an interim solution on salesforce stack exchange presented by Mohith Shrivastava. His idea is to create a formula field on the Account object that retrieves the fields you are looking for and then query for the formula field in the remote object. "CreatedBy.FirstName + ' ' +CreatedBy.LastName".
Hope this helps.