• Raghu kattula
  • NEWBIE
  • 20 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
Class


public class Trigger_New_Map 
{
    public Static void CreateContactRecord(Set<id> a)
    {
  
        List<Account> acc = [select id,Name,Phone,Industry from Account where id in :a];
        List<Contact> Cont = New List<Contact>();
        for(Account EA: acc)
        {
            Contact Con = New Contact();
            Con.LastName = EA.Name;
            Con.Phone = EA.phone;
            Con.Description = EA.Industry;
            Cont.add(Con); 
        }
        Insert Cont;
   
    }
  
}


TRIGGER


trigger Trigger_New_Map_Trigger on Account (After insert) 
{
  
    Map<id,Account> acc = Trigger.NewMap;
     set<id> a = acc.keySet();   
    Trigger_New_Map.CreateContactRecord(a);
}





 
public class Json_Parser 
{

    Public String JsonString {set;get;}
    Public Map<String,Object> Result {set;get;}
    
    
    public Json_Parser()
    {
        Result = new Map<String,Object>(); 
        JsonString = '{"Name":"Raghu","age":[10,20,30,40],"Industry":"Energy","Rating":"Hot"}';
        System.JSONParser jp = JSON.createParser(JsonString);
        while(jp.nextToken()!=null)
        {
            Result.put(jp.getText(), jp.getCurrentToken());
            
        }
    }
    public static void Execute()
    {
        // System.debug('Values are '+ Result) ;
    }
    
}
Component



<aura:component controller="Class_Searchtext">
    
    <aura:attribute name="acc" type="Account[]" />
    <aura:attribute name="Search" type="String" />
    
  <lightning:card class="slds-m-around_medium" title="Accounts" iconName="standard:account">
       
       <aura:set attribute="actions">
            <lightning:buttonGroup>
            <lightning:button label="New" />
            <lightning:button label="Import" />
            <lightning:button label="Printable" />
            </lightning:buttonGroup>
       </aura:set>
      <div class="slds-m-around_medium">
          
      <lightning:layout>
          <lightning:layoutItem size="6">
     <lightning:input label="Enter name to search" value="{!v.Search}" />
          </lightning:layoutItem>
          
           <lightning:layoutItem size="6">
              
        <lightning:button label="Search" onclick="{!c.click}"  />
              </lightning:layoutItem>
          </lightning:layout>
          
          
          
         <lightning:layout multipleRows="true">
           
      <aura:iteration items="{!v.acc}" var="a">
          <lightning:layoutItem size="3" padding="around-small">
      Name:{!a.Name}
      Phone:{!a.Phone}
      Rating:{!a.Rating}
        </lightning:layoutItem>
          
          </aura:iteration>
          </lightning:layout>
      </div>
          
          
 </lightning:card>
</aura:component>


Apex class


public class Class_Searchtext
{
  @AuraEnabled
    Public Static List<Account> getaccount(String searchtext)
    {
        String query = 'select id,name,industry,phone,rating from Account where name like \'%'+searchtext+ '%\'';
        List<Account> accounts = Database.query(query);
        Return accounts;
    }
    
}


Controller



({
    click : function(component, event, helper)
    
    {
        var a= component.get("c.Search");
        var action = component.get("c.getaccount");
        
        action.setParams({"searchtext":a});
        action.setCallback(this,function(response){
            var st= response.getState();
            if(st=='SUCCESS')
            {
                var r = response.getReturnValue();
                alert('search results are ');
                component.set("v.acc",r);
            }
            
        });
                       
         $A.enqueueAction(action);                  
    }
})

Application


<aura:application extends="force:slds">
    <c:LC_SearchAccount_v2/>
    
</aura:application>
Class


public class Trigger_New_Map 
{
    public Static void CreateContactRecord(Set<id> a)
    {
  
        List<Account> acc = [select id,Name,Phone,Industry from Account where id in :a];
        List<Contact> Cont = New List<Contact>();
        for(Account EA: acc)
        {
            Contact Con = New Contact();
            Con.LastName = EA.Name;
            Con.Phone = EA.phone;
            Con.Description = EA.Industry;
            Cont.add(Con); 
        }
        Insert Cont;
   
    }
  
}


TRIGGER


trigger Trigger_New_Map_Trigger on Account (After insert) 
{
  
    Map<id,Account> acc = Trigger.NewMap;
     set<id> a = acc.keySet();   
    Trigger_New_Map.CreateContactRecord(a);
}





 
Component



<aura:component controller="Class_Searchtext">
    
    <aura:attribute name="acc" type="Account[]" />
    <aura:attribute name="Search" type="String" />
    
  <lightning:card class="slds-m-around_medium" title="Accounts" iconName="standard:account">
       
       <aura:set attribute="actions">
            <lightning:buttonGroup>
            <lightning:button label="New" />
            <lightning:button label="Import" />
            <lightning:button label="Printable" />
            </lightning:buttonGroup>
       </aura:set>
      <div class="slds-m-around_medium">
          
      <lightning:layout>
          <lightning:layoutItem size="6">
     <lightning:input label="Enter name to search" value="{!v.Search}" />
          </lightning:layoutItem>
          
           <lightning:layoutItem size="6">
              
        <lightning:button label="Search" onclick="{!c.click}"  />
              </lightning:layoutItem>
          </lightning:layout>
          
          
          
         <lightning:layout multipleRows="true">
           
      <aura:iteration items="{!v.acc}" var="a">
          <lightning:layoutItem size="3" padding="around-small">
      Name:{!a.Name}
      Phone:{!a.Phone}
      Rating:{!a.Rating}
        </lightning:layoutItem>
          
          </aura:iteration>
          </lightning:layout>
      </div>
          
          
 </lightning:card>
</aura:component>


Apex class


public class Class_Searchtext
{
  @AuraEnabled
    Public Static List<Account> getaccount(String searchtext)
    {
        String query = 'select id,name,industry,phone,rating from Account where name like \'%'+searchtext+ '%\'';
        List<Account> accounts = Database.query(query);
        Return accounts;
    }
    
}


Controller



({
    click : function(component, event, helper)
    
    {
        var a= component.get("c.Search");
        var action = component.get("c.getaccount");
        
        action.setParams({"searchtext":a});
        action.setCallback(this,function(response){
            var st= response.getState();
            if(st=='SUCCESS')
            {
                var r = response.getReturnValue();
                alert('search results are ');
                component.set("v.acc",r);
            }
            
        });
                       
         $A.enqueueAction(action);                  
    }
})

Application


<aura:application extends="force:slds">
    <c:LC_SearchAccount_v2/>
    
</aura:application>
I signed up for the Salesforce Developer Edition and received an email with a link to activate it. Instead of getting a page enter my password, it instead directs me to the login page. I tried to reset the password and I receive a link by email, but clicking on the link displays a message that the link has expired after 24 hours or has already been used.

Any suggestions on how I can activate the account?