• Niraj Singh 28
  • NEWBIE
  • 60 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 4
    Replies
Hi, I know using "COMPONENT" event child component communicate with parent componet. but is this possible vice versa?
Can parent component communicate with child component using "COMPONENT" event or not?
Hello All,
I am new in salesforce development and want to know two things JobId and BatchId, and alos want to track my batch means how many record got to fails from processing.


Thanking you
Niraj Singh
Hi folk,

I am new in lightning application developer and here i have seen that we can achive same design using lightning tas as well as using ui tags then what is difference here.

Please read my complete post.
 
Hi Folk,

I have needed to create a link and provide to someone to get login in my salesforce org.



Thanks 
Hello All,

I have needed to modify validity value of an input but not getting modified after setting this value. Please have a look on my code suggest what i am doing wrong here.
IsValid:function(cmp,evt,helper){
        var contactFields=cmp.find("contactField");
        var blank=0;
        blank++;        
        var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;        
        if(contactFields.length != undefined){           
            var allvalid=contactFields.reduce(function(validSoFar,inputCmp){                
                inputCmp.showHelpMessageIfInvalid();
                if(inputCmp.get("v.name")=='VSMemail'){
                    var conEmail=inputCmp.get("v.VSMemail");
                    if(reg.test(conEmail) == false)
                    {  
                        inputCmp.set('v.validity', {valid:false, badInput :true}); 
                        
                    }
                }
                return validSoFar && inputCmp.get("v.validity").valid;
            },true); 
            return allvalid;
        }
Hello All,

I needed to change value of messageWhenValueMissing using javascript.


Thanks & HNY2019
Hello,
I have needed to validate input email on blur of text field but i am unable to fire onblur on <lightning:input.
Please read full post before answer and give me appropriate solution.


Thanks & HNY 2019
I am having a junction object named "Assignemnt" which is having Lookup relationship to two objects "Project" and "Consultant".
Here My requirement is that same project can not assgned to a consultant which is having for same as for example:-

Niraj PHP
Niraj .Net
Then Again not should be
Niraj PHP

Please guide me......
Hello All,
When i reached to component using navigatetocomponent then Horizontal scroll is not working on salesforce1. I am getting stuck not getting solution for this please if you know any way for that please share me.


Thanks & HNY 2019.
Hello,

I have needed to write onblur event of div which is desingned to have a background image But this is not working.If some one have implemented this functionality then please share me.
Hi,
I am feeling more comfort in coding jquery insted javascript can i do in lightning component if then please do me clear how can import jquery api from static resources.


Thanks and Happy new year in Advance
I have designed lightning component in two section one for left and another for right, here i have needed to Scroll Y only for left section using <ui:scrollerWrapper> but it does'nt work.  <ui:scrollerWrapper> works for full page including both panel.
If you have relevant solution then reply.
Hello,

I am working on salesforce 1 mobile app when i am changing some in code it is refleting on browser but not on salesforce 1 App.
I have needed to redirect on another component after clicking on an image. 
Hello Experts

I am new in saleforce lightning application development. Here I have needed some desing like a bootstrap in lightning component.
Is this good practice to use bootstrap in lightning or not.
How can i use <lightning:navigation> for custom component using javascript code
Here i have changed my component but not reflecting changes what i have done, Loading Previoud design.

<aura:component controller="ContactsController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">   
  <aura:attribute name="carinfo" type="Car__c[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.gocarinfo}" />
    <aura:iteration var="cars" items="{!v.carinfo}">
<lightning:button class="{! v.selected ? 'tile selected' : 'tile' }" onclick="{!c.onBoatClick}">
        <div style="background-image: url(https://vehicalsm-dev-ed--c.visualforce.com/resource/1545310276000/Hatchback_image?);" class="innertile">
            <div class="lower-third">
                <h1 class="slds-truncate">{!cars.Name}</h1>
                <p>{!cars.Car_type__c}</p>
            </div>
        </div>
    </lightning:button> 
        </aura:iteration>   
       </aura:component>

 
Here I have written code for lightning component. I have needed that when error occures then button should not call action 

<aura:component controller="ContactsController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
    <aura:attribute name="conInfo" type="contact" default="{'sobjectType':'contact','LastName':'','firstName':''}"/>
    <!-- CREATE NEW Contact -->
    <div aria-labelledby="newconform" style="display:flex;justify-content:center;">
        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default" style="width:40%;">
        
            
            <form class="slds-form--stacked">          
                <lightning:input  aura:id="conform" label="First Name"
                                 name="VSMfname"
                                 value="{!v.conInfo.firstName}"
                                 messageWhenValueMissing="First Name is Required."
                                 required="true"/> 
                <lightning:input aura:id="conform" label="Last Name"
                                 name="VSMlname"                            
                                 value="{!v.conInfo.lastName}"
                                 messageWhenValueMissing="Last Name is Required."
                                 required="true"/>
                <lightning:input aura:id="conform" label="Email"
                                 name="VSMemail"                            
                                 value="{!v.conInfo.email}"
                                 messageWhenValueMissing="Email is Required."
                                 required="true"/>
                  <lightning:input aura:id="conform" label="Phone"
                                 name="VSMphone"                            
                                 value="{!v.conInfo.phone}"
                                 messageWhenValueMissing="Phone is Required."  
                                 required="true"/>
                   <lightning:input aura:id="conform" label="Street"
                                 name="VSMstreet"                            
                                 value="{!v.conInfo.MailingStreet}"
                                 messageWhenValueMissing="Street is Required."    
                                 required="true"/>
                   <lightning:input aura:id="conform" label="City"
                                 name="VSMcity"                            
                                 value="{!v.conInfo.MailingCity}"
                                 messageWhenValueMissing="City is Required."    
                                 required="true"/>
                 <lightning:input aura:id="conform" label="State"
                                 name="VSMstate"                            
                                 value="{!v.conInfo.MailingState}"
                                 messageWhenValueMissing="State is Required."  
                                 required="true"/>
                        <lightning:input aura:id="conform" label="Country"
                                 name="VSMcountry"                            
                                 value="{!v.conInfo.MailingCountry}"
                                 messageWhenValueMissing="Country is Required."         
                                 required="true"/>
                <lightning:button label="Next" 
                                  class="slds-m-top--medium"
                                  variant="brand"
                                  onclick="{!c.clickCreate}"/>
            </form>
            <!-- / CREATE Contact -->
            
        </fieldset>
        <!-- / BOXED AREA -->
    </div>
    
    
</aura:component>
How can i design responsive table as per bootstrap which break the td in new row if small screen size. Table should not take x-scroll.
Please have a look below, what i am going to do wrong.
<aura:component implements="force:appHostable" controller="ContactOperation">
    <aura:attribute name="contacts" type="contact[]"/>
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>    
    <aura:Iteration var="con" Items="{!v.contacts}">
        <lightning:outputField value="{!con.FirstName}"></lightning:outputField>
    </aura:Iteration>
    
</aura:component>


({
           // Load expenses from Salesforce
    doInit: function(component, event, helper) {
        // Create the action
        var action = component.get("c.getAllContact");
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.contacts", response.getReturnValue());
            }
            else {
                console.log("Failed with state: " + state);
            }
        });
        // Send action off to be executed
        $A.enqueueAction(action);
    }
    
})


public class ContactOperation {
 @RemoteAction
    public static List<contact> getAllContact(){
        List<contact> lstContact=[Select firstName,LastName, Phone, Email, Title,Account.Name from contact];
        return lstcontact;
    }
}
Here i have changed my component but not reflecting changes what i have done, Loading Previoud design.

<aura:component controller="ContactsController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">   
  <aura:attribute name="carinfo" type="Car__c[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.gocarinfo}" />
    <aura:iteration var="cars" items="{!v.carinfo}">
<lightning:button class="{! v.selected ? 'tile selected' : 'tile' }" onclick="{!c.onBoatClick}">
        <div style="background-image: url(https://vehicalsm-dev-ed--c.visualforce.com/resource/1545310276000/Hatchback_image?);" class="innertile">
            <div class="lower-third">
                <h1 class="slds-truncate">{!cars.Name}</h1>
                <p>{!cars.Car_type__c}</p>
            </div>
        </div>
    </lightning:button> 
        </aura:iteration>   
       </aura:component>

 
Here I have written code for lightning component. I have needed that when error occures then button should not call action 

<aura:component controller="ContactsController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">
    <aura:attribute name="conInfo" type="contact" default="{'sobjectType':'contact','LastName':'','firstName':''}"/>
    <!-- CREATE NEW Contact -->
    <div aria-labelledby="newconform" style="display:flex;justify-content:center;">
        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default" style="width:40%;">
        
            
            <form class="slds-form--stacked">          
                <lightning:input  aura:id="conform" label="First Name"
                                 name="VSMfname"
                                 value="{!v.conInfo.firstName}"
                                 messageWhenValueMissing="First Name is Required."
                                 required="true"/> 
                <lightning:input aura:id="conform" label="Last Name"
                                 name="VSMlname"                            
                                 value="{!v.conInfo.lastName}"
                                 messageWhenValueMissing="Last Name is Required."
                                 required="true"/>
                <lightning:input aura:id="conform" label="Email"
                                 name="VSMemail"                            
                                 value="{!v.conInfo.email}"
                                 messageWhenValueMissing="Email is Required."
                                 required="true"/>
                  <lightning:input aura:id="conform" label="Phone"
                                 name="VSMphone"                            
                                 value="{!v.conInfo.phone}"
                                 messageWhenValueMissing="Phone is Required."  
                                 required="true"/>
                   <lightning:input aura:id="conform" label="Street"
                                 name="VSMstreet"                            
                                 value="{!v.conInfo.MailingStreet}"
                                 messageWhenValueMissing="Street is Required."    
                                 required="true"/>
                   <lightning:input aura:id="conform" label="City"
                                 name="VSMcity"                            
                                 value="{!v.conInfo.MailingCity}"
                                 messageWhenValueMissing="City is Required."    
                                 required="true"/>
                 <lightning:input aura:id="conform" label="State"
                                 name="VSMstate"                            
                                 value="{!v.conInfo.MailingState}"
                                 messageWhenValueMissing="State is Required."  
                                 required="true"/>
                        <lightning:input aura:id="conform" label="Country"
                                 name="VSMcountry"                            
                                 value="{!v.conInfo.MailingCountry}"
                                 messageWhenValueMissing="Country is Required."         
                                 required="true"/>
                <lightning:button label="Next" 
                                  class="slds-m-top--medium"
                                  variant="brand"
                                  onclick="{!c.clickCreate}"/>
            </form>
            <!-- / CREATE Contact -->
            
        </fieldset>
        <!-- / BOXED AREA -->
    </div>
    
    
</aura:component>
Please have a look below, what i am going to do wrong.
<aura:component implements="force:appHostable" controller="ContactOperation">
    <aura:attribute name="contacts" type="contact[]"/>
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>    
    <aura:Iteration var="con" Items="{!v.contacts}">
        <lightning:outputField value="{!con.FirstName}"></lightning:outputField>
    </aura:Iteration>
    
</aura:component>


({
           // Load expenses from Salesforce
    doInit: function(component, event, helper) {
        // Create the action
        var action = component.get("c.getAllContact");
        // Add callback behavior for when response is received
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.contacts", response.getReturnValue());
            }
            else {
                console.log("Failed with state: " + state);
            }
        });
        // Send action off to be executed
        $A.enqueueAction(action);
    }
    
})


public class ContactOperation {
 @RemoteAction
    public static List<contact> getAllContact(){
        List<contact> lstContact=[Select firstName,LastName, Phone, Email, Title,Account.Name from contact];
        return lstcontact;
    }
}