• akkk
  • NEWBIE
  • 15 Points
  • Member since 2016
  • Salesforce Developer
  • Webdhmal Technology

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 21
    Replies
Hi all,

is it possile to onClick on Account Record in LWC after that show all related to contact records in new Navigation tab ?


Thanks
AKKK
 
  • February 01, 2023
  • Like
  • 0
Hi all,

how to add the External (bootstrap css) in lwc
i have this but its not working
folder structure is  bootstrap/bootstrap.min.css

import { LightningElement } from 'lwc';
import { loadStyle } from 'lightning/platformResourceLoader';
import bootstrap from '@salesforce/resourceUrl/bootstrap';

export default class BootstrapComp extends LightningElement {
    renderedCallback() {
        Promise.all([
           
            loadStyle(this, bootstrap + '/bootstrap.min.css'),
        ])
            .then(() => {
                alert('Files loaded.');
            })
            .catch(error => {
                alert(error.body.message);
            });
    }
}
Thanks
akkk
  • April 13, 2022
  • Like
  • 0
Hi all,

Please support on the new question.

How to create the lwc component Custom Progress Bar for lead Ststus?
any example

Thanks
akkk
  • October 12, 2021
  • Like
  • 0
Hi All,
 
How to change the Custome object owner id  after insert the Record. with Trigger ?
Note-> there is no any relationship with the custome object to user but only Email id same in both place.

Thanks
akkk
  • February 05, 2021
  • Like
  • 0
Hi All,

how to write a Trigger after insert the account Records create Task and send email .


Thanks
akkk
  • January 29, 2021
  • Like
  • 0
Hi all
is it possbile ?
count the sum of the child records on the child object not on the Parent object with trigger .

Thanks
akkk
  • January 22, 2021
  • Like
  • 0
Hi all,

Plese uspport how to count the each child record for each parent records on child object with trigger
ex->
child record 5 for 1 parent record but count on the Child object
child record 2 for other 1 parent record but count on the Child object

Thanks
akkk
 
  • January 22, 2021
  • Like
  • 0
Hi ALL,

this is condition i have Account object and ObjectName__c if the Record Created on the Account object then Created on the ObjectName__c New Record if the existing Record then only update the Record

Thanks
akkk
  • January 11, 2021
  • Like
  • 0
Hi All,

How to Trigger Perform after insert after update if the EXISTING record only go and update if the new then create New Records ?

Thanks
akkk
  • January 09, 2021
  • Like
  • 0
Hi All,

Please any one support me that How to perform the Upsert Function with Apex Trigger ?

Thanks
akkk
  • January 09, 2021
  • Like
  • 0
Hi All,
Please support i am getting the Recrod type of the Contact Object its find after that when am i clicking on the Next Button for Creating a Record facing the Error The Erro User-added image
the Component => <aura:component controller="recordtypeContact" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    
    <aura:handler name="init" value="{!this}" action="{!c.fetchListOfRecordTypes}"/>
    
    <aura:attribute name="lstOfRecordType" type="String[]" />
    <aura:attribute name="isOpen" type="boolean" default="false" />
 
  <div class="slds-m-around--x-large">
    <lightning:button label="Create a contact" onclick="{!c.openModal}" />
  </div>    
   <!-- Model Box Start -->    
    <aura:if isTrue="{!v.isOpen}">
        <div role="dialog" tabindex="-1" aria-labelledby="header43" class="slds-modal slds-fade-in-open">
            <div class="slds-modal__container">
                <div class="slds-modal__header">
                    <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.closeModal}">
                        X<span class="slds-assistive-text">Cancel</span>
                    </button>
                    <h2 id="header43" class="slds-text-heading--medium">New Contact</h2>
                </div>
                
                <div class="slds-modal__content slds-p-around--medium">
                    <div class="slds-grid slds-wrap">
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                             <div class="slds-align--absolute-center">Select a Record Type</div>                            
                        </div>
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                            <ui:inputSelect aura:id="selectid">
                                <aura:iteration items="{!v.lstOfRecordType}" var="contact">                            
                                    <ui:inputSelectOption text="{!contact}" label="{!contact}"  />
                                </aura:iteration>
                            </ui:inputSelect>
                        </div>&nbsp; &nbsp;
                    </div>                   
                </div>
                
                <div class="slds-modal__footer">
                    <lightning:button class="slds-button slds-button--neutral" onclick="{!c.closeModal}">Cancel</lightning:button>
                    <lightning:button class="slds-button slds-button--brand" onclick="{!c.createRecord}">Next</lightning:button>
                </div>
            </div>
        </div>
        <div class="slds-backdrop slds-backdrop--open"></div>
    </aura:if>
</aura:component>
 controller part=>
({
 
   
   fetchListOfRecordTypes: function(component, event, helper) {
      var action = component.get("c.fetchRecordTypeValues");
      action.setCallback(this, function(response) {
         component.set("v.lstOfRecordType", response.getReturnValue());
      });
      $A.enqueueAction(action);
   },
 
   
   createRecord: function(component, event, helper) {
      component.set("v.isOpen", true);
 
      var action = component.get("c.getRecTypeId");
      var recordTypeLabel = component.find("selectid").get("v.value");
      action.setParams({
         "recordTypeLabel": recordTypeLabel
      });
      action.setCallback(this, function(response) {
         var state = response.getState();
         if (state === "SUCCESS") {
            var createRecordEvent = $A.get("e.force:createRecord");
            var RecTypeID  = response.getReturnValue();
            createRecordEvent.setParams({
               "entityApiName": 'Contact',
               "recordTypeId": RecTypeID
            });
            createRecordEvent.fire();
             
         } else if (state == "INCOMPLETE") {
            var toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
               "title": "Oops!",
               "message": "No Internet Connection"
            });
            toastEvent.fire();
             
         } else if (state == "ERROR") {
            var toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
               "title": "Error!",
               "message": "Please contact your administrator"
            });
            toastEvent.fire();
         }
      });
      $A.enqueueAction(action);
   },
 
   closeModal: function(component, event, helper) {
      // set "isOpen" attribute to false for hide/close model box
      component.set("v.isOpen", false);
   },
 
   openModal: function(component, event, helper) {
      // set "isOpen" attribute to true to show model box
      component.set("v.isOpen", true);
   },
})
 apex code =>
public class recordtypeContact {
    
    public static Map<Id, String> recordtypemap {get;set;}
    
   @AuraEnabled        
    public static List<String> fetchRecordTypeValues(){
        List<Schema.RecordTypeInfo> recordtypes = Contact.SObjectType.getDescribe().getRecordTypeInfos();    
        recordtypemap = new Map<Id, String>();
        for(RecordTypeInfo rt : recordtypes){
            if(rt.getName() != 'Master')
            recordtypemap.put(rt.getRecordTypeId(), rt.getName());
        }        
        return recordtypemap.values();
    }
    
    @AuraEnabled
    public static Id getRecTypeId(String recordTypeLabel){
        Id recid = Schema.SObjectType.Contact.getRecordTypeInfosByName().get(recordTypeLabel).getRecordTypeId();        
        return recid;
    }      

}


Thanks
Akhan25
  • May 04, 2020
  • Like
  • 0
Hi all

I am getting the Error when am i inserting the Record in the Task Object but same i am ok with the Account Object and Contact Object. but facing the Error with Task Object

Component =>
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Task" onsuccess ="{!c.onSuceesssAction}">
                <div class="slds-box">
                    <!--showing the records -->
                            <lightning:card title="New Task" iconName="standard:task">
                                    <lightning:inputField fieldName="Description"/>
                                    <lightning:inputField fieldName="ActivityDate"/>
                                    <lightning:inputField fieldName="Priority"/>
                                     <lightning:inputField fieldName="Status"/>
                                    <lightning:inputField fieldName="Subject"/>
                            
                            <!--for save records after edit -->
                                <aura:set attribute="actions">
                                    <lightning:button label="Save" type="Submit"/>
                                </aura:set>
                           </lightning:card>      
                 </div>
                    
    </lightning:recordEditForm>
</aura:component>
component js =>
({
    onSuceesssAction : function(component, event, helper) {
        alert('Record has been Updated successfully !!');
    
        
    }
})



Thanks
akhan25
  • May 04, 2020
  • Like
  • 0
Hi all

i am not able to creating a project with VSC because when am i going to creating a project then find flowing errors

internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module '../package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
   
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)


Thanks
akhan
  • April 15, 2020
  • Like
  • 0
Hi all ,

i have code
trigger sampletrigger on object(after insert,after update)
{
List<object2>obj2list  = new list<object2>();
for(object1 obj1 : trigger.new)
{
​​​​​If(obj1.status =='approved')
{
Object2 obj2 = new object2();
Obj2.FirstNsme  = obj1.firstname;
Obj2.lastnsme = obj1.lastname;
obj2.city = obj1.city;
obj2.status = obj1.status;
Obj2list.add(obj2);
}
}
Database.insert(obj2list,false);
}
the question is that how to send a email with Template if the Status is Approved ?
  • April 13, 2020
  • Like
  • 0
Hi all ,

i am getting a issus with the Registraion form when i am inserting the Records this is my Code
this is my calss
public class CustomerRegistrationClass {
        @auraEnabled
    public static string createAccount(Account acc){
        // exception handaling
        try{
            insert acc;
            return acc.Id;
        }catch(exception e){
            return 'Exception:'+e.getMessage();
        }
    }
}
this is my application :-
<aura:application extends="force:slds" controller="CustomerRegistrationClass">
    <aura:attribute name="accountRecord" type="Account" default="{
                                                                 'sobjectType':'Account',
                                                                      Industry:'Education'
                                                                 }"/>  <!--     its by defult industry-->
        <div class="slds-container--x-large slds-m-left_xx-large">
            <lightning:card title="Customer Registration Form" iconName="standard:account">
                <aura:set attribute="actions">
                    <lightning:button label="Save" onClick="{!c.saveData}"/>                
                    <lightning:button label="Cancel" onClick="{!c.cancelData}"/>
                        
                </aura:set>
                <div class="slds-m-left_x-large slds-m-right_x-large">
                    <lightning:input label="Name" value="{!v.accountRecord.Name}"/>
                    <lightning:input label="Phone" value="{!v.accountRecord.Phone}"/>
                    <lightning:input label="Industry" value="{!v.accountRecord.Industry}"/>
                </div>    
             </lightning:card>
    
    </div>
    
    
</aura:application>
this is my component :-
({
    saveData : function(component, event, helper) {
        var account = component.get("v.accountRecord"); //showing the defult valus
        alert('test message');
        console.log(account);
        
        var action = component.get("c.createAccount"); // action with Apex calss method so called c
        action.setParams({"acc":account});
        action.setCallback(this,function(response){
            var state = response.getState();
            console.log(state);
            if(state == "SUCCESS"){
                var result= response.getReturnValue();
                console.log(result);
                alert(result);
            }
        })
        $A.enqueueAction(action);
    },// one function completed on save data
    cancelData: function(component, event, helper){
        component.set("v.accountRecord",null);
    }
})

thanks
akhan
  • April 06, 2020
  • Like
  • 0
Hi Friends

i have two object object 1 and object 2 withoud any relationship condition 1;- both have same fields ex= firstName,city, status
if the first time insrt a record in object 1 then status is New.but doest not insrt Record in object 2.
conditon 2 :- if the update status approved then insert the record in Object 2.

please support

Thanks
Ishrat
 
  • October 28, 2019
  • Like
  • 0
Hi Everyone

how to solave a problem when i am gererating a Partner WSDL from Sourse org After That Going to Generate the Targer Class WSDL Generating a Apex Code from WSDL then showing a error 


Please anyone provide the Soluation
User-added image
  • November 07, 2018
  • Like
  • 0
its my Trigger

// this trigger used and sum of the contact on the account object
trigger countcontacts on Contact (after insert, after delete) {
    Set<Id> aId = new Set<Id>();
    
    if(Trigger.isInsert){
        System.debug('Insert contact for trigger.new - '+Trigger.New);
        for(Contact opp : Trigger.New){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,sum_of_the_contact__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.sum_of_the_contact__c=con.size();
        }
        update acc;
        System.debug('Number is '+acc);
    }
    
    if(Trigger.isDelete){
        System.debug('delete contact for trigger.old - '+Trigger.Old);
        for(Contact opp : Trigger.old){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,sum_of_the_contact__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.sum_of_the_contact__c=con.size();
            
        }
        update acc;
        System.debug('Number is '+acc);
    }
    }
    *****************************************
    its my test class but only covred 58% how to 100% please slove
    
    
    @isTest
public class countcontacts_Test{
    @isTest
    static void tesMethodss()
    {
        account ac=new account(name='test');
        insert ac;
        
        contact cont=new contact(lastName='test',firstName='test', Accountid=ac.Id);
        insert cont;
      
        
    }
}
**************************************************************
  • April 13, 2017
  • Like
  • 0
Hi
1) what is the diffrence between Original Territory Management and Enterprise Territory Management ?
2)  what is the diffrence between Customizable Forecasts and Collaborative Forecasts ?
any one please support me about Enterprise Territory Management and how to ebable  with the Developer Edition ?
how to ebable the Collaborative Forecasts with the developer Edition ??

Thanks
aqleem
  • February 23, 2017
  • Like
  • 0
hi

i have a Seniro that on Hirerarchy top to lower like top label to assign Manager and buttom level assign to sales person
1- if the sale person record is private then is it possible that all data to see the Manager ?? because manager on the top level ?
2 - can i set the  private sales person data for the Manager ?
3- can i wriete a sharing rule for the buttom to top ?

thanks
aqleem
  • February 21, 2017
  • Like
  • 0
Hi all,

is it possile to onClick on Account Record in LWC after that show all related to contact records in new Navigation tab ?


Thanks
AKKK
 
  • February 01, 2023
  • Like
  • 0
Hi All,

how to write a Trigger after insert the account Records create Task and send email .


Thanks
akkk
  • January 29, 2021
  • Like
  • 0
Hi all
is it possbile ?
count the sum of the child records on the child object not on the Parent object with trigger .

Thanks
akkk
  • January 22, 2021
  • Like
  • 0
Hi all,

Plese uspport how to count the each child record for each parent records on child object with trigger
ex->
child record 5 for 1 parent record but count on the Child object
child record 2 for other 1 parent record but count on the Child object

Thanks
akkk
 
  • January 22, 2021
  • Like
  • 0
Hello everone, I need help on the following error message:
Reason: Apex trigger LeadConvert caused an unexpected exception, contact your administrator: LeadConvert: execution of AfterInsert

caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Your lead is missing a field mapping for the Pet Primary Caregiver,Household Allergies,Household Pets,Top Dogg K9 Exposure fields. 

LeadConvert Trigger:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
trigger LeadConvert on Lead (after insert) {

    ID acctID, ContID;
    /* Get the Id and MasterLabel from LeadStatus object */
    LeadStatus convertStatus = [ select Id, MasterLabel from LeadStatus where IsConverted = true limit 1 ];
    
  List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();

  for (Lead lead: Trigger.new) {
    /* if (!lead.isConverted && lead.WebForm__c == 'Free Trial') { */
        

        try {
        Account acct = new Account(Name=lead.LastName + ' Household', recordtypeid = '0123i000000paRjAAI');
        insert acct;
        // Once the account is inserted, the sObject will be populated with an ID. Get this ID.
        acctID = acct.ID;
      Contact cont = new Contact( Contact_type__c='Applicant', AccountId=acctID);
        insert cont;
            contID = cont.ID;
      
    } catch(DmlException e) {
        System.debug('An unexpected error has occurred: ' + e.getMessage());
    }
        
        

        if (!lead.isConverted) {
      Database.LeadConvert lc = new Database.LeadConvert();
      lc.setLeadId(lead.Id);
            
            //String oppName = lead.Name;
      //lc.setOpportunityName(oppName);
      lc.setAccountId(acctID);
      lc.setConvertedStatus(convertStatus.MasterLabel);
            Database.LeadConvertResult lcr = Database.convertLead(lc);
      System.assert(lcr.isSuccess());
            
      //leadConverts.add(lc);
    }
  }

  //if (!leadConverts.isEmpty()) { 
    //List<Database.LeadConvertResult> lcr = Database.convertLead(leadConverts);

Not sure if I should make these fields not required on the Salesforce side to prevent error or deactivate the trigger. Also discovered that a blank application can be submitted which should not be the case. Please advise how to remove the error message and if it should be addressed on the application side on the website or the Salesforce side. 
Hi All,

How to Trigger Perform after insert after update if the EXISTING record only go and update if the new then create New Records ?

Thanks
akkk
  • January 09, 2021
  • Like
  • 0
Hi All,

Please any one support me that How to perform the Upsert Function with Apex Trigger ?

Thanks
akkk
  • January 09, 2021
  • Like
  • 0
Hi All,
Please support i am getting the Recrod type of the Contact Object its find after that when am i clicking on the Next Button for Creating a Record facing the Error The Erro User-added image
the Component => <aura:component controller="recordtypeContact" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global">
    
    <aura:handler name="init" value="{!this}" action="{!c.fetchListOfRecordTypes}"/>
    
    <aura:attribute name="lstOfRecordType" type="String[]" />
    <aura:attribute name="isOpen" type="boolean" default="false" />
 
  <div class="slds-m-around--x-large">
    <lightning:button label="Create a contact" onclick="{!c.openModal}" />
  </div>    
   <!-- Model Box Start -->    
    <aura:if isTrue="{!v.isOpen}">
        <div role="dialog" tabindex="-1" aria-labelledby="header43" class="slds-modal slds-fade-in-open">
            <div class="slds-modal__container">
                <div class="slds-modal__header">
                    <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{!c.closeModal}">
                        X<span class="slds-assistive-text">Cancel</span>
                    </button>
                    <h2 id="header43" class="slds-text-heading--medium">New Contact</h2>
                </div>
                
                <div class="slds-modal__content slds-p-around--medium">
                    <div class="slds-grid slds-wrap">
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                             <div class="slds-align--absolute-center">Select a Record Type</div>                            
                        </div>
                        <div class="slds-size--1-of-2 slds-large-size--1-of-2">
                            <ui:inputSelect aura:id="selectid">
                                <aura:iteration items="{!v.lstOfRecordType}" var="contact">                            
                                    <ui:inputSelectOption text="{!contact}" label="{!contact}"  />
                                </aura:iteration>
                            </ui:inputSelect>
                        </div>&nbsp; &nbsp;
                    </div>                   
                </div>
                
                <div class="slds-modal__footer">
                    <lightning:button class="slds-button slds-button--neutral" onclick="{!c.closeModal}">Cancel</lightning:button>
                    <lightning:button class="slds-button slds-button--brand" onclick="{!c.createRecord}">Next</lightning:button>
                </div>
            </div>
        </div>
        <div class="slds-backdrop slds-backdrop--open"></div>
    </aura:if>
</aura:component>
 controller part=>
({
 
   
   fetchListOfRecordTypes: function(component, event, helper) {
      var action = component.get("c.fetchRecordTypeValues");
      action.setCallback(this, function(response) {
         component.set("v.lstOfRecordType", response.getReturnValue());
      });
      $A.enqueueAction(action);
   },
 
   
   createRecord: function(component, event, helper) {
      component.set("v.isOpen", true);
 
      var action = component.get("c.getRecTypeId");
      var recordTypeLabel = component.find("selectid").get("v.value");
      action.setParams({
         "recordTypeLabel": recordTypeLabel
      });
      action.setCallback(this, function(response) {
         var state = response.getState();
         if (state === "SUCCESS") {
            var createRecordEvent = $A.get("e.force:createRecord");
            var RecTypeID  = response.getReturnValue();
            createRecordEvent.setParams({
               "entityApiName": 'Contact',
               "recordTypeId": RecTypeID
            });
            createRecordEvent.fire();
             
         } else if (state == "INCOMPLETE") {
            var toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
               "title": "Oops!",
               "message": "No Internet Connection"
            });
            toastEvent.fire();
             
         } else if (state == "ERROR") {
            var toastEvent = $A.get("e.force:showToast");
            toastEvent.setParams({
               "title": "Error!",
               "message": "Please contact your administrator"
            });
            toastEvent.fire();
         }
      });
      $A.enqueueAction(action);
   },
 
   closeModal: function(component, event, helper) {
      // set "isOpen" attribute to false for hide/close model box
      component.set("v.isOpen", false);
   },
 
   openModal: function(component, event, helper) {
      // set "isOpen" attribute to true to show model box
      component.set("v.isOpen", true);
   },
})
 apex code =>
public class recordtypeContact {
    
    public static Map<Id, String> recordtypemap {get;set;}
    
   @AuraEnabled        
    public static List<String> fetchRecordTypeValues(){
        List<Schema.RecordTypeInfo> recordtypes = Contact.SObjectType.getDescribe().getRecordTypeInfos();    
        recordtypemap = new Map<Id, String>();
        for(RecordTypeInfo rt : recordtypes){
            if(rt.getName() != 'Master')
            recordtypemap.put(rt.getRecordTypeId(), rt.getName());
        }        
        return recordtypemap.values();
    }
    
    @AuraEnabled
    public static Id getRecTypeId(String recordTypeLabel){
        Id recid = Schema.SObjectType.Contact.getRecordTypeInfosByName().get(recordTypeLabel).getRecordTypeId();        
        return recid;
    }      

}


Thanks
Akhan25
  • May 04, 2020
  • Like
  • 0
Hi all

I am getting the Error when am i inserting the Record in the Task Object but same i am ok with the Account Object and Contact Object. but facing the Error with Task Object

Component =>
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
    <lightning:recordEditForm recordId="{!v.recordId}" objectApiName="Task" onsuccess ="{!c.onSuceesssAction}">
                <div class="slds-box">
                    <!--showing the records -->
                            <lightning:card title="New Task" iconName="standard:task">
                                    <lightning:inputField fieldName="Description"/>
                                    <lightning:inputField fieldName="ActivityDate"/>
                                    <lightning:inputField fieldName="Priority"/>
                                     <lightning:inputField fieldName="Status"/>
                                    <lightning:inputField fieldName="Subject"/>
                            
                            <!--for save records after edit -->
                                <aura:set attribute="actions">
                                    <lightning:button label="Save" type="Submit"/>
                                </aura:set>
                           </lightning:card>      
                 </div>
                    
    </lightning:recordEditForm>
</aura:component>
component js =>
({
    onSuceesssAction : function(component, event, helper) {
        alert('Record has been Updated successfully !!');
    
        
    }
})



Thanks
akhan25
  • May 04, 2020
  • Like
  • 0
Hi all ,

i have code
trigger sampletrigger on object(after insert,after update)
{
List<object2>obj2list  = new list<object2>();
for(object1 obj1 : trigger.new)
{
​​​​​If(obj1.status =='approved')
{
Object2 obj2 = new object2();
Obj2.FirstNsme  = obj1.firstname;
Obj2.lastnsme = obj1.lastname;
obj2.city = obj1.city;
obj2.status = obj1.status;
Obj2list.add(obj2);
}
}
Database.insert(obj2list,false);
}
the question is that how to send a email with Template if the Status is Approved ?
  • April 13, 2020
  • Like
  • 0
Hi all ,

i am getting a issus with the Registraion form when i am inserting the Records this is my Code
this is my calss
public class CustomerRegistrationClass {
        @auraEnabled
    public static string createAccount(Account acc){
        // exception handaling
        try{
            insert acc;
            return acc.Id;
        }catch(exception e){
            return 'Exception:'+e.getMessage();
        }
    }
}
this is my application :-
<aura:application extends="force:slds" controller="CustomerRegistrationClass">
    <aura:attribute name="accountRecord" type="Account" default="{
                                                                 'sobjectType':'Account',
                                                                      Industry:'Education'
                                                                 }"/>  <!--     its by defult industry-->
        <div class="slds-container--x-large slds-m-left_xx-large">
            <lightning:card title="Customer Registration Form" iconName="standard:account">
                <aura:set attribute="actions">
                    <lightning:button label="Save" onClick="{!c.saveData}"/>                
                    <lightning:button label="Cancel" onClick="{!c.cancelData}"/>
                        
                </aura:set>
                <div class="slds-m-left_x-large slds-m-right_x-large">
                    <lightning:input label="Name" value="{!v.accountRecord.Name}"/>
                    <lightning:input label="Phone" value="{!v.accountRecord.Phone}"/>
                    <lightning:input label="Industry" value="{!v.accountRecord.Industry}"/>
                </div>    
             </lightning:card>
    
    </div>
    
    
</aura:application>
this is my component :-
({
    saveData : function(component, event, helper) {
        var account = component.get("v.accountRecord"); //showing the defult valus
        alert('test message');
        console.log(account);
        
        var action = component.get("c.createAccount"); // action with Apex calss method so called c
        action.setParams({"acc":account});
        action.setCallback(this,function(response){
            var state = response.getState();
            console.log(state);
            if(state == "SUCCESS"){
                var result= response.getReturnValue();
                console.log(result);
                alert(result);
            }
        })
        $A.enqueueAction(action);
    },// one function completed on save data
    cancelData: function(component, event, helper){
        component.set("v.accountRecord",null);
    }
})

thanks
akhan
  • April 06, 2020
  • Like
  • 0
Hi Friends

i have two object object 1 and object 2 withoud any relationship condition 1;- both have same fields ex= firstName,city, status
if the first time insrt a record in object 1 then status is New.but doest not insrt Record in object 2.
conditon 2 :- if the update status approved then insert the record in Object 2.

please support

Thanks
Ishrat
 
  • October 28, 2019
  • Like
  • 0
I'm trying to complete the Hands-on Challenge for Manage Your Picklist Values, and I'm getting the following message "... Couldn’t find picklist formula with the correct information. Please double check the instructions" I used the formula provided:

Use the formula editor to set the Default Value for the Macaron Flavor picklist as follows:CASE(MONTH(TODAY()),1, "Gingerbread",2, "Strawberry",4, "Chocolate",7, "Raspberry",11, "Pumpkin",12, "Mint", "Vanilla")

These were the only instructions, 

As an administrator, you want the default value for the macaron flavor to be the flavor of the month for some months, otherwise, the default is vanilla.

I'm not quite sure what I'm doing wrong.
its my Trigger

// this trigger used and sum of the contact on the account object
trigger countcontacts on Contact (after insert, after delete) {
    Set<Id> aId = new Set<Id>();
    
    if(Trigger.isInsert){
        System.debug('Insert contact for trigger.new - '+Trigger.New);
        for(Contact opp : Trigger.New){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,sum_of_the_contact__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.sum_of_the_contact__c=con.size();
        }
        update acc;
        System.debug('Number is '+acc);
    }
    
    if(Trigger.isDelete){
        System.debug('delete contact for trigger.old - '+Trigger.Old);
        for(Contact opp : Trigger.old){
            aId.add(opp.AccountId);
        }
        List<Account> acc = [select id,sum_of_the_contact__c from Account where Id in:aId];
        List<Contact> con = [select id from contact where AccountId in :aId];
        
        for(Account a : acc){
            a.sum_of_the_contact__c=con.size();
            
        }
        update acc;
        System.debug('Number is '+acc);
    }
    }
    *****************************************
    its my test class but only covred 58% how to 100% please slove
    
    
    @isTest
public class countcontacts_Test{
    @isTest
    static void tesMethodss()
    {
        account ac=new account(name='test');
        insert ac;
        
        contact cont=new contact(lastName='test',firstName='test', Accountid=ac.Id);
        insert cont;
      
        
    }
}
**************************************************************
  • April 13, 2017
  • Like
  • 0
Hi
1) what is the diffrence between Original Territory Management and Enterprise Territory Management ?
2)  what is the diffrence between Customizable Forecasts and Collaborative Forecasts ?
any one please support me about Enterprise Territory Management and how to ebable  with the Developer Edition ?
how to ebable the Collaborative Forecasts with the developer Edition ??

Thanks
aqleem
  • February 23, 2017
  • Like
  • 0
hi

i have a Seniro that on Hirerarchy top to lower like top label to assign Manager and buttom level assign to sales person
1- if the sale person record is private then is it possible that all data to see the Manager ?? because manager on the top level ?
2 - can i set the  private sales person data for the Manager ?
3- can i wriete a sharing rule for the buttom to top ?

thanks
aqleem
  • February 21, 2017
  • Like
  • 0
Hi,

How do I autopopulate the fields of object A in object B.  So if a user clicks on  'New License' (which is in related lists of object A), the user will be navigated to object B. Here, the Region field in object A should be autopopulated in B. 

FYI, 'Region' in object A is formula field and 'RegionT' in object B is picklist field.

Thank you.