• AM_SFDC
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I am trying to create Documentation resourse for my Student registration page.Iam not bale to refrense the components defined as well as  not seeing Example tab .Please let mek nwo where  i have missed.
doc link : https://kinglion-dev-ed.lightning.force.com/auradocs/reference.app
foolowing is my code details
User-added imageUser-added imageUser-added imageUser-added imageUser-added image

I am trying to display some text on Page by using Lighting componets.i am not getting that text on click on check box Below is my code .Let me knwo where is my code wrong.

A>Component attribute define

Lightning tag with aura id defined in it

**<aura:attribute name="CheckBoxValue" type="Boolean" default="false"/>**


**<lightning:input aura:id="checkBoxAM" label="Are you new to this course" name="HaveYouTakenCourseBefore" type="checkbox" onchange="{!c.onClickCheckBox}"/>**


B>This is my Aura if conditiontag along with text to be displayed

Hello You have checked this box

C>THis is my JS function in Controller

onClickCheckBox: function(component,event,helper) {
// accesing the value of attribute HaveYouTakenCourseBefore;
// Call function defined in helper;
// hlpr.<Function Name in helper>
console.log("This text is from helper function"); helper.onClickCheckBoxhelper(component); }

D>This is my FUnction defined in helper

onClickCheckBoxhelper : function(component) {
//body of helper resourse
// define logic of your function
console.log("This text is from helper function");
var checkBoxValue =component.find("checkBoxAM").get("v.checked"); component.set("v.checkBoxAM",checkBoxValue)
;

E> Calling this Component in my Lightning App
PFA screen shot 
I am trying to add a new contact record with below condition where Account has greter than  99 employees  an limit is 1.
Though new  contact is not getting created in accounts where  employess are more than 99.
let me know what is wrong in below code.
(New to apex)
Contact c = new Contact(Account = [SELECT Name FROM Account 
    WHERE NumberOfEmployees > 99 Limit 1]);
c.FirstName = 'Test';
c.LastName = 'AM';
System.debug('Contact name  is '+c);    
 ****This is my component details**** 
Attribute:
<aura:component >
    <aura:attribute name="ABC" type="string" default="false"/>

**This is lightning button details**
<lightning:button label="Submit" onclick="{!c.doSubmit}"></lightning:button>

**THis is my funtion doSubmit in controller**

({
    doSubmit : function(cmp, evt, hlpr) {
 //accessing the value in attribute ABC
        var initialABCValue = cmp.get("v.abc");
                if(initialABCValue == "true"){
                       alert("Value is true");
 //setting value of ABC to false
            cmp.set("v.abc","false");
        }
            else{
                     alert("Value is False");
 //setting value of ABC to true
            cmp.set("v.abc","true");
        }
    }
})

Now on click on button "Submit" on Page  i should get initially false value ,on next click it should be true value accordingly .As my function says so 

I am not getting changin vlaues on pop up just getting "False"
Can you helpmeguys with correction in code.[![enter image description here][1]][1]On click of button "Submit" pop value should change to false to true to false accordingly
 ****This is my component details**** 
Attribute:
<aura:component >
    <aura:attribute name="ABC" type="string" default="false"/>

**This is lightning button details**
<lightning:button label="Submit" onclick="{!c.doSubmit}"></lightning:button>

**THis is my funtion doSubmit in controller**

({
    doSubmit : function(cmp, evt, hlpr) {
 //accessing the value in attribute ABC
        var initialABCValue = cmp.get("v.abc");
                if(initialABCValue == "true"){
                       alert("Value is true");
 //setting value of ABC to false
            cmp.set("v.abc","false");
        }
            else{
                     alert("Value is False");
 //setting value of ABC to true
            cmp.set("v.abc","true");
        }
    }
})

Now on click on button "Submit" on Page  i should get initially false value ,on next click it should be true value accordingly .As my function says so 

I am not getting changin vlaues on pop up just getting "False"
Can you helpmeguys with correction in code.[![enter image description here][1]][1]On click of button "Submit" pop value should change to false to true to false accordingly