Display Generic sObject in Lightning

Display Generic sObject in Lightning

 

In the last post we study how we can iterate map in Lightning. There is one more thing which we face many time is dynamic field binding. Visualforce wit dynamic field binding we can dynamically create field instance but in lightning this is a major limitation.

Today we will see how we can use dynamic sObject binding in visualforce. For this we will create a sample component to display dynamic fields.

Here we will create app to get Object details. for demo I have select Account object we can select any object here. We can also select any fields here including the parent fields(cross reference field).

Now we will pass the object and field name in another component. Where we will display them on UI.

So here we are using JavaScript to to get data from the field. This is similar of what we have done in Map Iteration post.

To display on UI I am using lightning:formattedText we can also use any other component as well.

dYnamicsObject.png

You can find the complete code here as well.

DO you want to add anything let me know in comments section. Happy programming 🙂

Advertisements

Iterate Map In Lightning

Iterate Map In Lightning

Usages of Lightning is increasing day by day. We face many challenge while doing development in Lightning.  One of the challenge which I face recently is we can’t iterate map in lightning using aura:iteration.  Map is commonly used collection type which provide Key value pair to easy binding of data.

Today I will shae a code sample of how we can iterate map in Lightning easily.

First we need a Controller which will return Map to us.

 

Next we will create an APP to display It on UI.

We can easily iterate map in Javascript. So in App controller we will iterate this Map and will create a List. Now we can  easily iterate that List in the app.

This is the output which we will get.

Map Iteration

Do you like the post. Or want to say anything. Please let me know in comments section.

Check your computer …..Male or Female :-)

Check  your computer “male” or “female”??

1. Open Notepad

2. Type the following line in notepad:

CreateObject(“SAPI.SpVoice”).Speak”I love you”

3. Save file as computer_gender.vbs in any location

4. Run the file by double clicking on it… If you hear a male voice, your computer is a boy If you hear a female voice, your computer is a girl (:

Note: Turn on the speaker before running the file 🙂