• Sachin Bhalerao 17
  • NEWBIE
  • 250 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 49
    Questions
  • 22
    Replies
Dear Team ,

Greetings !!!

Team i want to ask if i want to insert data using Lightning Data table in lightning component is it possible ? I am able to perform inline edit using lightning data table . If i pass data to apex class in insert menthod is it possible that data get saved . M facing error .

Thanks & Regards
Sachin Bhalerao

 
Dear Team ,

Greetings !!!

Please let me know can we use Picklist in Lightning data table in lightning component.

Thanks & Regards
Sachin Bhalerao
Dear Team ,

I have to edit email template in salesforce classic . Plz have a look on snapshot and let me know how to editUser-added imageThanks & Regards
Sachin Bhalerao
Dear Team ,

Thank you for your continous support !!!

I have to Edit email template that is built on salesforce classic . Plz have a look on snapshot and let me know from where i will get canvas for email .User-added imageThanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

I am calling my Component on visual force page but on webbrowser controls are not geting loaded . Plz have a look code and snapshot of blank screen , suggest some solution .
VF page code:

<apex:page Controller="Matchpick">
    
 <apex:includeLightning />
<apex:pageBlock >
     <apex:pageBlockSection >
           <div id="Con" />
    </apex:pageBlockSection>
     </apex:pageBlock>
      

         <script>
  
            $Lightning.use("c:Radioegrun", function() {
                
              
                $Lightning.createComponent(

                    "c:Radioeg",

                    {},

                    "Con",

                    function(cmp) {

                        console.log("Component is created!");

                        console.log(cmp);

                    });

                });

        

          </script>
    
</apex:page>

Thanks & RegardsUser-added image
Sachin Bhalerao
Dear Team ,

Greetings !!!

Plz let me know how to apply CSS on radio button , i applied some classes but its not looking good . Plz have a look on sample code .
Component file :

<aura:component controller="Matchpick" >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Yes', 'value': 'Yes'},
       {'label': 'No', 'value': 'No'},
       {'label': 'Sometime', 'value': 'Sometime'},  
       {'label': 'Partially', 'value': 'Partially'}, 
       ]"/>

     <aura:attribute name="optionstwo" type="List" default="[

       {'label': 'CSS', 'value': 'CSS'},
       {'label': 'Controller', 'value': 'Controller'},
       {'label': 'Helper', 'value': 'Helper'},  
       {'label': 'Angular', 'value': 'Angular'}, 
       ]"/>

  <aura:attribute name="optionChoosenRadio" type="Ques__c" default="{ 'sobjectType' : 'Ques__c',
                                                              'Quesone__c' : '',
                                                                    'Questwo__c':''
                                                             }"/>
    
<form class="slds-form-element">
   
 <div class="slds-form-element">
     <div class="slds-form-element__control">
 <div class = "slds-col slds-size--5-of-5 " style="display: inline;">
      
 <lightning:radioGroup name="radioGroup"
    label="Does Lightning Component uses Javascript"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio.Quesone__c }"
    type="radio"
    required="true"/>
</div>
</div>
    </div>
    
    
    
    <br/>
     <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGrouptwo"
    label="Which file not exist in Lightning"
    variant="label-inline"
    options="{!v.optionstwo }"
    value="{!v.optionChoosenRadio.Questwo__c}"
    type="radio"
    required="true"/>
</div>
    
    <br/>
     <lightning:button label="Submit Ans" 
                                          class="slds-m-top--medium"
                                          variant="base"
                                          onclick="{!c.handleChange}"/>   
</form>
</aura:component>

User-added imageThanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

Plz show me some easy example through which i am able to unserstand how to insert radiobutton value in database using lightning component . How to define attributes in component file and to manage attributes in controller.js files.

Thanks & Regards
Sachin Bhalerao
Dear team ,

Thank you for your continous support . Plz let me know how i perform insertion of textbox value and radiobutton in custom object . Plz have a look on code and snapshot of custom object .
Component :

<aura:component controller="Matchpick" >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Yes', 'value': 'Yes'},
       {'label': 'No', 'value': 'No'},
       {'label': 'Sometime', 'value': 'Sometime'},  
       {'label': 'Partially', 'value': 'Partially'}, 
       ]"/>


  <aura:attribute name="optionChoosenRadio" type="String" default=""/>
    
  <aura:attribute name="accObj" type="Questions__c" default="{ 'sobjectType' : 'Questions__c',

                                                             'Name' : '',

                                                             'Does_Lightning_Component_uses_Javascript__c' : ''
                                                             }"/>



    <ui:inputText label="Name" value="{!v.accObj.Name}"/>


 <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGroup"
    label="Does Lightning Component uses Javascript"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio }"
    type="radio"
    required="true"/>
</div>

     <lightning:button label="Submit Ans" 
                                          class="slds-m-top--medium"
                                          variant="brand"
                                          onclick="{!c.handleChange}"/>   

</aura:component>

APEX 

public class Matchpick {
    
      @AuraEnabled
    public static Map<String, String> getques(){

        Map<String, String> options = new Map<String, String>();

        //get Account Industry Field Describe

        Schema.DescribeFieldResult fieldResult = Questions__c.Does_Lightning_Component_uses_Javascript__c.getDescribe();

        //get Account Industry Picklist Values

        List<Schema.PicklistEntry> pList = fieldResult.getPicklistValues();

        for (Schema.PicklistEntry p: pList) {

            //Put Picklist Value & Label in Map

            options.put(p.getValue(), p.getLabel());

        }

        return options;

    }
    
    
    
 @AuraEnabled //Save Questions Data

    Public static void createAccount(Questions__c objacc)
    {

        try{

            //Insert Questions Record

            insert objacc;

             

        }catch(Exception e){

            //throw exception message

            throw new AuraHandledException(e.getMessage());

        }

        finally {

        }

    }

}

Controller.js

({
	handleChange : function(component, event, helper) {
		//alert('hello');
		var a = component.get('v.options');
        

        var b = component.get('v.optionChoosenRadio');
          var tempAccount = component.get('v.accObj');
         helper.saveAccount(component, event);

	}
})

Helper.js

({
	 saveAccount : function(component, event) 
    {

        var acc = component.get("v.optionChoosenRadio");

        var action = component.get("c.createAccount");

        action.setParams({

            objacc : acc

        });

        action.setCallback(this,function(response){

            var state = response.getState();

            if(state === "SUCCESS"){
              var res = response.getReturnValue();
                alert('Record is Created Successfully');

            } else if(state === "ERROR"){

                var errors = action.getError();

                if (errors) {

                    if (errors[0] && errors[0].message) {

                        alert(errors[0].message);

                    }

                }

            }else if (status === "INCOMPLETE") {

                alert('No response from server or client is offline.');

            }

        });      

        $A.enqueueAction(action);

    }
})

User-added image

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

In controller file this attribute value is not getting captured   var tempAccount = component.get('v.accObj');

I defined in component file in this way 

<aura:attribute name="accObj" type="Questions__c" default="{ 'sobjectType' : 'Questions__c',

                                                             'Name' : '',

                                                             'Does_Lightning_Component_uses_Javascript__c' : ''
                                                             }"/>



    <ui:inputText label="Name" value="{!v.accObj.Name}"/>

Please let me know where i am making mistake.

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

M facing this error . Would you plz let me know exact reason of this error User-added image

Plz suggest me some solutions

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

I have to match radio button selected value to default value of picklist on click event of submit button . If it radio button selected value matched with default value of picklist column Match__c became 1 else it should be 0 . Plz have a look on sample code
Component:

<aura:component controller="Matchpick" >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Yes', 'value': 'Yes'},
       {'label': 'No', 'value': 'No'},
       {'label': 'Sometime', 'value': 'Sometime'},  
       {'label': 'Partially', 'value': 'Partially'}, 
       ]"/>


  <aura:attribute name="optionChoosenRadio" type="String" default=""/>




 <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGroup"
    label="Does Lightning Component uses Javascript"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio }"
    type="radio"
    required="true"/>
</div>

     <lightning:button label="Submit Ans" 
                                          class="slds-m-top--medium"
                                          variant="brand"
                                          onclick="{!c.handleChange}"/>   

</aura:component>

Controller.js


({
	handleChange : function(component, event, helper) {
		//alert('hello');
		var a = component.get('v.options');
        var b = component.get('v.optionChoosenRadio');
         helper.saveAccount(component, event);

	}
})

Helper.js

({
	 saveAccount : function(component, event) {

        var acc = component.get("v.optionChoosenRadio");

        var action = component.get("c.createAccount");

        action.setParams({

            objacc : acc

        });

        action.setCallback(this,function(response){

            var state = response.getState();

            if(state === "SUCCESS"){
              var res = response.getReturnValue();
                alert('Record is Created Successfully');

            } else if(state === "ERROR"){

                var errors = action.getError();

                if (errors) {

                    if (errors[0] && errors[0].message) {

                        alert(errors[0].message);

                    }

                }

            }else if (status === "INCOMPLETE") {

                alert('No response from server or client is offline.');

            }

        });      

        $A.enqueueAction(action);

    }
})

APEX class

public class Matchpick {
    
      @AuraEnabled
    public static Map<String, String> getques(){

        Map<String, String> options = new Map<String, String>();

        //get Account Industry Field Describe

        Schema.DescribeFieldResult fieldResult = Questions__c.Does_Lightning_Component_uses_Javascript__c.getDescribe();

        //get Account Industry Picklist Values

        List<Schema.PicklistEntry> pList = fieldResult.getPicklistValues();

        for (Schema.PicklistEntry p: pList) {

            //Put Picklist Value & Label in Map

            options.put(p.getValue(), p.getLabel());

        }

        return options;

    }
    
    
    
 @AuraEnabled //Save Questions Data

    Public static void createAccount(Questions__c objacc)
    {

        try{

            //Insert Questions Record

            insert objacc;

             

        }catch(Exception e){

            //throw exception message

            throw new AuraHandledException(e.getMessage());

        }

        finally {

        }

    }

}

App

<aura:application access="GLOBAL">
    <c:Radioeg/>
</aura:application>

Please provide me some solutions

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings for the day !!!

I have some confusion with these two words what is the difference between SFDC and SFDX ? Please try to explain difference in easy words

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Please clarify me about Sandbox , Roles and Profile , Batch APEX Class in easy words . These are the most frequently asked question in interviews .

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

Please let me know how to  capture selected value of group radio button in lightning component . My code are as follows when m debugging my code it picks both value not selected one .
Component

<aura:component >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Agent', 'value': 'Agent'},
       {'label': 'Agency', 'value': 'Agency'},
       ]"/>


  <aura:attribute name="optionChoosenRadio" type="String" default=""/>




 <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGroup"
    label="Choose Option"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio }"
    type="radio"
    required="true" onchange="{!c.handleChange}"  />
</div>


</aura:component>


Controller.js

({
	handleChange : function(component, event, helper) {
		//alert('hello');
		var a = component.get('v.options');
        
	}
})

Thanks & Regards
Sachin Bhalerao​​​​​​​
Dear Team ,

Greetings !!!

How can i use Lightning group radio button in Component file of Lightning component . How can i bind radio button with piclist in custom object .
<aura:component controller="BISPController">
	        <aura:attribute name="NewCon" 

            type="Questions__c"

            default="{ 'sobjectType': 'Questions__c',

                     
                     
                     'Does_Lightning_Component_uses_Javascript__c	' : '',
                     
                     'Which_file_not_part_of_lightning_comp__c' : '',}" />
    
      <form>
                 <div class="slds-form-element">
          <div class="slds-form-element__control">
              <label class="slds-form-element__label" for="form-element-01">Does Lightning Component uses Javascript</label>
            <div style="background-color:white; height:33px; border:solid; border-color:rgb(217,219,221); border-radius:4px;">
                  <force:inputField value="{!v.NewCon.Does_Lightning_Component_uses_Javascript__c}" class="form-control" />
              </div>
               
    </div>
  </div>  
          
          <div class="slds-form-element">
          <div class="slds-form-element__control">
              <label class="slds-form-element__label" for="form-element-01">Which file not part of lightning comp</label>
            <div style="background-color:white; height:33px; border:solid; border-color:rgb(217,219,221); border-radius:4px;">
                  <force:inputField value="{!v.NewCon.Which_file_not_part_of_lightning_comp__c}" class="form-control" />
              </div>
               
    </div>
  </div>      
          
          <div>
                          <ui:button label="Save" press="{!c.save}"/>
          </div>
           </form>
    
</aura:component>

 
Hello Team ,

I newly created one salesforce instance but after previewing my application m getting this error on web browser :

Lightning components require My Domain. Please contact your system administrator for more information.

Please let me know what to do next i have to wait for some time or some error is thr
Dear Team ,

Thank you for your continous support!!!

I have to create one project on lightning component in which i have to create Objective type test in which there are 4 options for single questions and user have to select one right answers . And data get stored in Custom object and i need to display result also when user click on submit button . (For Eg 6 answer correct out of 10)

Please provide me any link or overview how can i start this project .

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

Please clarify me how   <aura:attribute name="mycolumns" type="List"/>

Type=List will works in Attribute how it is different from array.
Dear Team ,

Greetings !!!

I write a code to pull data on datatable in Lightning component . On Helper.js file i write following code :

  action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                // Alert the user with the value returned
                // from the server

                component.set("v.acctList", response.getReturnValue());
            }
        });

I am unable to unserstand how  response.getState(); works and how   component.set("v.acctList", response.getReturnValue()); works .

Please describe me in wasy way how response.getReturnValue() gets populated .

Thanks & Regards
Sachin Bhalerao
Dear Team,

Thank you for continous support !!!

I built some components using LWC , I am continously using import Lightning Element and  extends LightningElement . Please describe these keywords in some easy way in order i am able to understand and use it properly .

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

Team i want to ask if i want to insert data using Lightning Data table in lightning component is it possible ? I am able to perform inline edit using lightning data table . If i pass data to apex class in insert menthod is it possible that data get saved . M facing error .

Thanks & Regards
Sachin Bhalerao

 
Dear Team ,

I have to edit email template in salesforce classic . Plz have a look on snapshot and let me know how to editUser-added imageThanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

In controller file this attribute value is not getting captured   var tempAccount = component.get('v.accObj');

I defined in component file in this way 

<aura:attribute name="accObj" type="Questions__c" default="{ 'sobjectType' : 'Questions__c',

                                                             'Name' : '',

                                                             'Does_Lightning_Component_uses_Javascript__c' : ''
                                                             }"/>



    <ui:inputText label="Name" value="{!v.accObj.Name}"/>

Please let me know where i am making mistake.

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings !!!

Please let me know how to  capture selected value of group radio button in lightning component . My code are as follows when m debugging my code it picks both value not selected one .
Component

<aura:component >
	 <aura:attribute name="options" type="List" default="[

       {'label': 'Agent', 'value': 'Agent'},
       {'label': 'Agency', 'value': 'Agency'},
       ]"/>


  <aura:attribute name="optionChoosenRadio" type="String" default=""/>




 <div class = "slds-col slds-size--2-of-2 " style="display: inline;">
 <lightning:radioGroup name="radioGroup"
    label="Choose Option"
    variant="label-inline"
    options="{!v.options }"
    value="{!v.optionChoosenRadio }"
    type="radio"
    required="true" onchange="{!c.handleChange}"  />
</div>


</aura:component>


Controller.js

({
	handleChange : function(component, event, helper) {
		//alert('hello');
		var a = component.get('v.options');
        
	}
})

Thanks & Regards
Sachin Bhalerao​​​​​​​
Hello Team ,

I newly created one salesforce instance but after previewing my application m getting this error on web browser :

Lightning components require My Domain. Please contact your system administrator for more information.

Please let me know what to do next i have to wait for some time or some error is thr
Dear Team ,

Thank you for your continous support!!!

I have to create one project on lightning component in which i have to create Objective type test in which there are 4 options for single questions and user have to select one right answers . And data get stored in Custom object and i need to display result also when user click on submit button . (For Eg 6 answer correct out of 10)

Please provide me any link or overview how can i start this project .

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Thank you for clearing my doubts !!!

Is it possible to create Lightning Web Component without installing Visual Studio code ? Through our salesforce account can we create LWC .

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Thank you for your replies !!!

I have one question regarding Type in attribute . Sometimes we use 
type=’Account[]’ and sometimes we use type=’Account’

Please let me know difference between 
type=’Account[]’ vs type=’Account’

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Trust you are doing fine !!!

Please explain me how sobjecttype Works in default property of attribute:

For eg my code :

<aura:component controller="ContactController">

        <aura:attribute name="NewCon" 

            type="Contact"

            default="{'sobjectType': 'Contact',

                       'FirstName': '',

                       'LastName': '',

                       'Email': '', 

                       'Phone': ''}"/>

        

        <form>        

            <ui:inputText value="{!v.NewCon.FirstName}" label="First" class="form-control"/>

            <ui:inputText value="{!v.NewCon.LastName}" label="Last" class="form-control" />

            <ui:inputEmail value="{!v.NewCon.Email}" label="Email" class="form-control" />

            <ui:inputText value="{!v.NewCon.Phone}" label="Phone Number" class="form-control"/>

            <ui:button label="Save" press="{!c.save}"/>

        </form>

    </aura:component>

Thanks & Regards
Sachin Bhalerao
 
Dear Team ,

Trust you are doing fine !!!

Please let me know Apex acts as a model or controller in Lightning Component .  One more thing through this diagram it is showing controller.js will call APEX class but in Lightning component file we are calling Controller in this way

<aura:component controller="AccountController">

plz let me know exactly the scenario 

User-added image

Thanks & Regards
Sachin Bhalerao
Dear Team ,

Greetings!!!

I am trying to to build one lightning component which can be integrated with External API . I made following remote settings plz have a look on img User-added imageBut API is not getting called on web browser . Plz have a look on imageUser-added imageMy code are as follws :

APEX Class 

public class httpCallOutCtrl {
  // Pass in the endpoint to be used using the string url
  @AuraEnabled
  public static Map < String,
  Object > getCalloutResponseContents(String url) {
 
    // Instantiate a new http object
    Http h = new Http();
 
    // Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
    HttpRequest req = new HttpRequest();
    req.setEndpoint(url);
    req.setMethod('GET');
 
    // Send the request, and return a response
    HttpResponse res = h.send(req);
    System.debug('response:--> ' + res.getBody());
 
    // Deserialize the JSON string into collections of primitive data types.
    Map < String,
    Object > resultsMap = (Map < String, Object > ) JSON.deserializeUntyped(res.getBody());
    system.debug('resultsMap-->' + resultsMap);
 
    return resultsMap;
  }
}

controller.js


({
    calloutCtrl : function(component, event, helper) {
        // Rates are quoted against the Euro by default. 
        // Quote against a different currency by setting the base parameter in your request.        
        var base = 'USD';
        helper.getResponse(component, base);
    },
 
})

Helper.js


({
    getResponse: function(component, base) {
        // create a server side action.       
        var action = component.get("c.getCalloutResponseContents");
        // set the url parameter for getCalloutResponseContents method (to use as endPoint) 
        action.setParams({
            "url": 'http://api.fixer.io/latest?base=' + base
        });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (component.isValid() && state === "SUCCESS") {
                // set the response(return Map<String,object>) to response attribute.      
                component.set("v.response", response.getReturnValue());
 
                // get the all rates from map by using key              
                var getAllRates = component.get("v.response")['rates'];
                var CurrencyList = [];
                // play a loop on rates object 
                for (var key in getAllRates) {
                    // push all rates with there Name in CurrencyList variable.        
                    CurrencyList.push(key + ' = ' + getAllRates[key]); // i.e : INR = 67.919  
                }
                // set the CurrencyList to ListOfCurrency attribute on component.           
                component.set("v.ListOfCurrency", CurrencyList);
            }
        });
 
        $A.enqueueAction(action);
    },
})

APP:

<aura:application extends="force:slds">
   <c:SampleComponent/>
  <!-- here c: is org. namespace prefix-->
</aura:application>

Please help me to sort out this issue

NOTE : M using code from this link : http://sfdcmonkey.com/2017/01/02/http-callout-lightning-component/

Thanks & Regards
Sachin Bhalerao

 
Dear Team ,

Greetings !!!

I created one lightning web component to update records using Lightning web component i used lightning-record-edit-form inside template . 

 <lightning-record-edit-form record-id={recordId} object-api-name="Contact"
    onsuccess={handleSuccess} onsubmit ={handleSubmit} >

M unable to unserstand exact difference between onsuccess and onsubmit .

One more thing in js file i used following code :

  handleSubmit(event) {
        // eslint-disable-next-line no-console
        console.log('onsubmit: '+ event.detail.fields);//Array of record field names or field IDs.
            
    }
    handleSuccess(event) {
        const updatedRecord = event.detail.id;
      // eslint-disable-next-line no-console
      console.log('onsuccess: ', updatedRecord);

M unable to unserstand the difference between event.detail.fields and event.detail.id .

Please provide me some easy explanation on these syntaxes.

Thanks & Regards
Sachin Bhalerao


 
Dear Team ,

Greetings !!!

I implemented one Lightning Web Component in whicg created one Data Table . I deployed that component to org , command ran successfully but that component not appearing in App Builder . 

Kindly have a look on screenshot and please provide me some solutions .

Thanks & Regards
Sachin BhaleraoImage of Command ran successfully