• Lightning Practice
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies
Trigger Test on Account (before insert,before Update,After Update) {
    
    if(trigger.isbefore&& trigger.isInsert ) {
        set<Id> acids =new set<Id>();
        for(Account ac:trigger.new){
            if(ac.ParentId!=null){
                acids.add(ac.ParentID);
            }
            
        }
        system.debug('acids'+acids);
        Map<string,string> mpads=new Map<string,string>();
        for(Account acc:[select id,Rating,ParentID from account where ID IN: acids]){
            system.debug('Rating'+acc.Rating);
            mpads.put(acc.ID,acc.Rating);
        }
        system.debug('mpads'+mpads);
        
        for(Account accc:trigger.new){
            
            if(accc.ParentId!=null){
                accc.Rating=mpads.get(accc.ParentID);
                
                system.debug('mpads==>'+mpads.get(accc.parentid));
            }
            
            
        }  
    }
    if(Trigger.isBefore && Trigger.isUpdate){
        set<Id> acids =new set<Id>();
        for(Account ac:trigger.new){
            if(ac.ParentId!=null){
                acids.add(ac.ParentID);
            }
            
        }
        system.debug('acids'+acids);
        Map<string,string> mpads=new Map<string,string>();
        for(Account acc:[select id,Rating,ParentID from account where ID IN: acids]){
            system.debug('Rating'+acc.Rating);
            mpads.put(acc.ID,acc.Rating);
        }
        system.debug('mpads'+mpads);  
        //  Map<Id,Account> olcAcc=trigger.oldMap;
        for(Account accc:trigger.new){
            Account olcAcc=trigger.oldMap.get(accc.id);
            if((accc.Rating!=olcAcc.Rating) && accc.ParentID==olcAcc.ParentID) {
                // accc.Rating=mpads.get(accc.ParentID);
                
                system.debug('mpads==>'+mpads.get(accc.parentid));
            }else {
                accc.Rating=mpads.get(accc.ParentID);
            }
            
            
        }  
    }  
HI all,

Help me out.
I need a SOSL wildcard that retrieves wildcard search exact results and near by
1.Exact Match
2.Starts with first 3 letters similar records.
3.If special characters exists in Name should retrive exact and similiar records
 I don't know my SOSl is behaving wierd,
string cus='*'+CustomerName+'*';

LIST<LIST<Sobject>> query ='FInd '+cus+' IN ALL Fields from Object__C(ID)';

Note: here CustomerName is formula field in Object__C

Please help me in good possible ways

Thanks,
Lightning Practice.
 
Hi All,

Please help
how to make default values for picklist value in map?  
In main component i have sub component 
<aura:component>
<aura:attribute name="pickValuesMap" Type="Map" default="{}">

<c:caseComp metadata="{!v.pickValuesMap.Status}" value="{!v.Obj.Status}" isEdit="true"/>
</aura:component>



pickValuesMap am getting all the field values as here {"Name":"Case Number",other values,"Name":"Status","PicklistValues:["New","Open"]"}

How to Make  default picklist value  Status with "New"

Thanks,
Lightning Practice.  
HI all,

add row fucntionality in lightning to save info to database? 

unable to save to database.
 
Thanks ,
karthik
Hi All,
How to use force:inputfield in aura:iteration?

<aura:iteration items="{!v.Accounts}" var="item">
{!item.Name}, {!item.Industry}
<br/>
</aura:iteration>
?
Thanks,
Ram.
Hi all,
how to find difference between two dates and need to get every mondays between two dates?
can any one help me out.

var startD=component.find('startDate').get('v.value'); 
        
        var lastD=component.find('lastDate').get('v.value');
       
        var diff= endDa - startDa;
getting NAN value?

Thanks ,
Ram.
Hi All,
Please correct me cannot able to handle event from parent to child.

Registered event in parent as 
<aura:registerEvent name="projectSelected" type="c:project_Phase_holdevent"/>

Controller.js to fire an event
 
var proj=component.find('project').get('v.value');
        var ProjectPhasesEvent = $A.get("e.c:project_Phase_holdevent"); 
        ProjectPhasesEvent.setParams({"project": proj}); 
        console.log('event fired'+proj);
        ProjectPhasesEvent.fire();

Event is firing well but cannot able to handle in child component
 
<aura:handler event="c:project_Phase_holdevent" action="{!c.setSelectedProjectId}"/>

Controller.js in child component
 
setSelectedProjectId : function(component, event, helper) {  
        
        var selectedProject = event.getParam("project"); 
        alert(selectedProject);
}

event
<aura:event type="APPLICATION" >
    <aura:attribute name="project" type="string" /> 
</aura:event>

please suggest what is wrong?on button click am firing child component

Thanks.
Ram 


 
Hi All,

how to refresh a individual component after clicking on save button?
that effects to see update information in the component

Thanks ,
Ram.
Hi All,

How to stop the event , when uncheck the checkbox of row selection in lightning:dataTable 
Hi All,
how to pass ID to Lightning:button in aura:iteration ?

can any one help out.

Thanks ,
Ram
Hi All,

Can any one help to inlineedit an entire row in aura iteration and save the record in lightning?

Thanks,
ns

 
Trigger Test on Account (before insert,before Update,After Update) {
    
    if(trigger.isbefore&& trigger.isInsert ) {
        set<Id> acids =new set<Id>();
        for(Account ac:trigger.new){
            if(ac.ParentId!=null){
                acids.add(ac.ParentID);
            }
            
        }
        system.debug('acids'+acids);
        Map<string,string> mpads=new Map<string,string>();
        for(Account acc:[select id,Rating,ParentID from account where ID IN: acids]){
            system.debug('Rating'+acc.Rating);
            mpads.put(acc.ID,acc.Rating);
        }
        system.debug('mpads'+mpads);
        
        for(Account accc:trigger.new){
            
            if(accc.ParentId!=null){
                accc.Rating=mpads.get(accc.ParentID);
                
                system.debug('mpads==>'+mpads.get(accc.parentid));
            }
            
            
        }  
    }
    if(Trigger.isBefore && Trigger.isUpdate){
        set<Id> acids =new set<Id>();
        for(Account ac:trigger.new){
            if(ac.ParentId!=null){
                acids.add(ac.ParentID);
            }
            
        }
        system.debug('acids'+acids);
        Map<string,string> mpads=new Map<string,string>();
        for(Account acc:[select id,Rating,ParentID from account where ID IN: acids]){
            system.debug('Rating'+acc.Rating);
            mpads.put(acc.ID,acc.Rating);
        }
        system.debug('mpads'+mpads);  
        //  Map<Id,Account> olcAcc=trigger.oldMap;
        for(Account accc:trigger.new){
            Account olcAcc=trigger.oldMap.get(accc.id);
            if((accc.Rating!=olcAcc.Rating) && accc.ParentID==olcAcc.ParentID) {
                // accc.Rating=mpads.get(accc.ParentID);
                
                system.debug('mpads==>'+mpads.get(accc.parentid));
            }else {
                accc.Rating=mpads.get(accc.ParentID);
            }
            
            
        }  
    }  
Hi All,

Please help
how to make default values for picklist value in map?  
In main component i have sub component 
<aura:component>
<aura:attribute name="pickValuesMap" Type="Map" default="{}">

<c:caseComp metadata="{!v.pickValuesMap.Status}" value="{!v.Obj.Status}" isEdit="true"/>
</aura:component>



pickValuesMap am getting all the field values as here {"Name":"Case Number",other values,"Name":"Status","PicklistValues:["New","Open"]"}

How to Make  default picklist value  Status with "New"

Thanks,
Lightning Practice.  
HI all,

add row fucntionality in lightning to save info to database? 

unable to save to database.
 
Thanks ,
karthik
Hi all,
how to find difference between two dates and need to get every mondays between two dates?
can any one help me out.

var startD=component.find('startDate').get('v.value'); 
        
        var lastD=component.find('lastDate').get('v.value');
       
        var diff= endDa - startDa;
getting NAN value?

Thanks ,
Ram.
Hi All,
Please correct me cannot able to handle event from parent to child.

Registered event in parent as 
<aura:registerEvent name="projectSelected" type="c:project_Phase_holdevent"/>

Controller.js to fire an event
 
var proj=component.find('project').get('v.value');
        var ProjectPhasesEvent = $A.get("e.c:project_Phase_holdevent"); 
        ProjectPhasesEvent.setParams({"project": proj}); 
        console.log('event fired'+proj);
        ProjectPhasesEvent.fire();

Event is firing well but cannot able to handle in child component
 
<aura:handler event="c:project_Phase_holdevent" action="{!c.setSelectedProjectId}"/>

Controller.js in child component
 
setSelectedProjectId : function(component, event, helper) {  
        
        var selectedProject = event.getParam("project"); 
        alert(selectedProject);
}

event
<aura:event type="APPLICATION" >
    <aura:attribute name="project" type="string" /> 
</aura:event>

please suggest what is wrong?on button click am firing child component

Thanks.
Ram 


 
Hi Team,

How to validate the fields in Flow?
1. validation profile or user ( Make it madatory based on profile)
2. How to validate blank or null values (for text)

Can someone let me know how I can do this?

Regards
Lakshmi
Hi All,

Can any one help to inlineedit an entire row in aura iteration and save the record in lightning?

Thanks,
ns