• NLakshman
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 42
    Questions
  • 4
    Replies
Hi All, 
'Summary Report' option is disabled in Picklist Field that is build using VF page as shown below and VF page is part of installed managed package. Please help how to enable the value 'Summary Report' for picklist field.
User-added image
Hi All, Receiving the below error message when trying to create the bulk of users using apex code, Please help to resolve it.

Line: undefined, Column: undefined
Response to EXEC was : Bad Message 414

reason: URI Too Long
. HTTP CODE[414]

Thanks in advance.
Able to save the form With space in ABN number in community portal built using lightning component, below is the screenshot for it. Please provide solution to trim the spaces in ABN number to avoid creating of duplicate firm with same ABN in lightning component.

User-added image
Hi All,

Display below error message when trying to open the case record in Salesforce. Please help with the solution.

User-added image
How to stop emails received by the External Partner community User in Salesforce?

Thanks in Advance
Can anyone help how to stop users from receiving emails by doing changes at user level in salesforce?
Can anyone help how to stop users from receiving emails at profile level in salesforce?

Thanks in Advance
Hi All,

I had requirement to create 'New Contact' from lightning component on clicking the button on other lightning component, for this created the new  'CreateContact' lightning component as code shown below and screen and included that on other lightning component.

Can someone help me with code to select the record type while creating the new contact using lightning component? As of now i have defaulted the record type.

Component:

<aura:component >
    <aura:attribute name="myContactFields" type="List" default="['AccountId','LastName', 'FirstName']" />
    <aura:registerEvent name="CmpEvent" type="c:SHM_CreateContactModelClose" />
    <aura:attribute name="recordTypes" type="list" default="Business,Individual"/>
    <lightning:messages />
    <lightning:recordForm
                          aura:id ="createContactForm"
                          objectApiName="Contact"
                          layoutType="Full"
                          columns="2"
                          mode="edit"
                          recordTypeId="0120k000000HOHkAAO"
                          onsubmit="{!c.handleSubmit}"                  
                          onsuccess="{!c.handleSuccess}"
                          oncancel="{!c.handleCancel}" />
</aura:component>

JS Controller:

({
    handleSuccess : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");
        toastEvent.setParams({
            "title": "Success!",
            "type":"success",
            "message": 'Contact Record has been created Successfully!!..'
        });
        toastEvent.fire();
        $A.get('e.force:refreshView').fire();
    },
    handleSubmit : function(component, event, helper) {
        //event.preventDefault(); // Prevent default submit
        
        component.find('createContactForm').submit(); // Submit form
        console.log('Successfully Created Contact Record');
    },
   
    handleCancel : function(component, event, helper) {
        var cmpEvent = component.getEvent("CmpEvent");
        cmpEvent.setParams({
            "closeModel" : false
        });
        cmpEvent.fire();
    },
})

Create Contact Pop Up

Thanks in Advance.
Hi,

Is there a way to embed or code to enable lightning-native lookup fields that will give the ability to not only search for the lookup item but will also give the option to create new lookup record if you want to as shown in below image.

User-added image

Thanks in Advance
Can anyone tell me how to add/include Standard New Contact Create link as button in salesforce lightning component?

i,e. When clicking a button on lightning component it should route to Standard Contact creation page.

Thanks in Advance.
Hi All,

I want to include a button to create new contact in lightning component, Could some one provide the logic for it.

Thanks in Advance.
Hi, Can Someone help me on below error, how to resolve it.

System.DmlException: Insert failed. First exception on row 1; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: RowCause (Specified value is reserved and cannot be used): [RowCause]
Hi, Can some help how can i get the manual share of old opporunity owner and update the same manual sharing to new opporutunity owner when opportunity owner is changed using triggers in salesforce.
Can anyone help me with code to display radio buttons when checkbox is checked in Visualforce?
User-added image
 
When a Case is created, email notification is sent to all members in the queue using case assignment rule. However when email is received instead of having all the queue members in the “To” field, user only see their own email address. Is it expected?
How to write the batch job that will query the leads with Lead Status = Converted, Activated In-Store to create the account, contact and other custom object 'BAN' that is associate to the account with 2 required fields BAN__c and Tax ID on lead object
public with sharing class opptycon
{
public static void updateContracts(Map<Id, Opportunity> opps){

        List<Contract> contractsToUpdate = new List<Contract>();

        List<Contract> contracts = getContractsByOppIds(opps.keyset());

        String manualOrderOutcome = CustomMetadataServices.getContractSettingsText('Manual_Ordering_Processing');

        for(Opportunity opp : opps.values()){

            List<ContractSortWrapper> contractListForOpportunity = ContractSortWrapper.getAllByOpportunityId(contracts, opp.Id);
            contractListForOpportunity.sort();

            if(!contractListForOpportunity.isEmpty()) {

                if(contractListForOpportunity[0].con.Total_ASOP_Submissions__c >= 1 && opp.Current_Process_State__c == 'Order' && (opp.TBC_Initial_Response__c == NULL || opp.TBC_Initial_Response__c == 'ERROR' ) && String.isBlank(opp.Order_Outcome__c)){


                    contractListForOpportunity[0].con.Order_Submission_Outcome__c = CustomMetadataServices.getContractSettingsText('Work_Support_Team');
                    contractListForOpportunity[0].con.Online_Customer_Experience__c = TRUE;
                    contractListForOpportunity[0].con.Order_Outcome__c = CustomMetadataServices.getContractSettingsText('WSS');
                    contractListForOpportunity[0].con.Order_Kickback_Reason__c = CustomMetadataServices.getKickbackReasonValue('System Error');
                    contractListForOpportunity[0].con.Customer_Email_Comments__c = opp.Customer_Email_Comments__c;
                    
                    opp.Order_Outcome__c = CustomMetadataServices.getContractSettingsText('WSS');
                    opp.Online_Customer_Experience__c = TRUE;

                    contractsToUpdate.add(contractListForOpportunity[0].con);
                }
                else{
                    contractListForOpportunity[0].con.Customer_Email_Comments__c = opp.Customer_Email_Comments__c;
                    contractsToUpdate.add(contractListForOpportunity[0].con);                    
                }
                    
            }

        }

        try{

            update contractsToUpdate;
            system.debug('CONTRACTS UPDATED ' + contractsToUpdate);
        }
        catch(DmlException ex){

            System.debug('ERROR WHILE UPDATING CONTRACTS: ' + ex.getMessage());
        }
    }

    public static List<Contract> getContractsByOppIds(Set<Id> oppIds){

        return [SELECT Order_Submission_Outcome__c, Online_Customer_Experience__c, Order_Outcome__c, Opportunity__c, Order_Kickback_Description__c, Send_Order_Form__c, Total_ASOP_Submissions__c, CreatedDate FROM Contract WHERE Opportunity__c IN :oppIds];
    }

}
Getting this error "System.DmlException: Update failed. First exception on row 106 with id 005800000057YTmAAM; first error: DEPENDENCY_EXISTS, Cannot complete this operation. This user is a target of a workflow field update. : Field Update : []" while executing below test class, pls tell what the issue?

@isTest(SeeAllData=false)
private class DirectRoleServiceTest {   
    private static User usr;
    
    private static void setupData() {
        TestUtility.insertEmployee(true);
        
        usr = [Select id from User where Id = :UserInfo.getUserId()];
    }
    
    static testMethod void test_processAllArea() {
        setupData();        
        
        System.RunAs(usr){
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();
            dsr.processMultiMaster('Area');
            dsr.processMainMaster('Area');
            dsr.processSharedMaster('Area');
            dsr.processUsersMaster('AVP');            
            Test.stopTest();
        }       
    }
    
    static testMethod void test_processAllRegion() {
        setupData();        
        
        System.RunAs(usr){
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();
            dsr.processMultiMaster('Region');
            dsr.processMainMaster('Region');
            dsr.processSharedMaster('Region');
            dsr.errorDoubleParent('RD','Manager');
            dsr.errorDoubleParent('RD','Location');
            dsr.errorMultiPNumber();
            dsr.processUsersMaster('RD');
            Test.stopTest();
        }
    }
    
    static testMethod void test_processAllSnrManager() {
        setupData();        
        
        System.RunAs(usr){
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();
            dsr.processMultiMaster('SM');
            dsr.processMainMaster('SM');
            dsr.processSharedMaster('SM');
            dsr.errorDoubleParent('SM','Manager');
            dsr.errorDoubleParent('SM','Location');
            dsr.errorMultiPNumber();
            dsr.processUsersMaster('SM');
            Test.stopTest();
        }
    }
    
    static testMethod void test_processAllTeam() {
        setupData();        
        
        System.RunAs(usr){
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();
            dsr.processMultiMaster('Team');
            dsr.processMainMaster('Team');
            dsr.processSharedMaster('Team');
            dsr.errorDoubleParent('TM','Manager');
            dsr.errorDoubleParent('TM','Location');
            dsr.processUsersMaster('TM');                
            Test.stopTest();
        }
    }
    
    static testMethod void test_processAllTeamRep() {
        setupData();        
        
        System.RunAs(usr){
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();                
            dsr.processMainMaster('TeamRep');
            dsr.processUsersMaster('AE'); 
            Test.stopTest();
        }
    }
    
    static testMethod void test_deactivateUser() {
        usr = [Select id from User where Id = :UserInfo.getUserId()];
        Employee__c emp = new Employee__c();
        emp.Name = 'Shawna Witek';
        emp.NTLogin__c = 'SWITEK1';
        emp.PNumber__c = '12514249';
        emp.Position_Title__c = 'P12545788';
        emp.EffDate__c = System.today();
        emp.Last_FOS_Update__c = System.today();
        emp.Primary_Dealer_Code__c = '3786149';
        emp.BD_Dealer_Code__c = '4489637';
        emp.Co_Sell_Dealer_Code__c = '4847288';
        emp.Segment__c = 'Area Sales';
        
        emp.Area__c = 'North Central';
        emp.Area_Vice_President__c = 'Marty Pisciotti';
        emp.AVP_PNumber__c = '12442681';
        emp.AVP_NTLogin__c = 'MPISCIO';
        emp.AVP_Email__c = 'martin.pisciotti@t-mobile.com';
        
        
        emp.Region__c = 'Houston';
        emp.Regional_Director__c = 'Winston Awadzi';
        emp.RD_PNumber__c = '12545788';
        emp.RD_NTLogin__c = 'WAWADZI';
        emp.RD_Email__c = 'winston.awadzi@t-mobile.com';
        
        emp.Senior_Manager__c = 'leo';
        emp.SM_PNumber__c = '1234567';
        emp.SM_NTLogin__c = '1234567';
        emp.SM_Email__c = 'winston@t-mobile.com';
        
        emp.Team__c = 'Chicago 1';
        emp.Team_Manager__c = 'Kevin Kirby';
        emp.TM_PNumber__c = '12427977';
        emp.TM_NTLogin__c = 'KKIRBY1';
        emp.TM_Email__c = 'kevin.kirby1@t-mobile.com';
        insert emp; 
        System.RunAs(usr){
            UserRole r = new UserRole(DeveloperName = 'AS_Test', Name = 'AS Test');
            insert r;
            User u = new User(
                ProfileId = [SELECT Id FROM Profile WHERE Name = 'Standard User'].Id,
                LastName = 'last',
                Email = 'test@amamama.com',
                Username = 'puser000@amamama.com' + System.currentTimeMillis(),
                CompanyName = 'TEST',
                Title = 'title',
                Alias = 'alias',
                TimeZoneSidKey = 'America/Los_Angeles',
                EmailEncodingKey = 'UTF-8',
                LanguageLocaleKey = 'en_US',
                LocaleSidKey = 'en_US',
                UserRoleId = r.Id,
                FOS_Object__c = 'Employee',
                Last_FOS_Update__c = System.today(),
                IsActive = TRUE,
                P_Number__c='12345'
            );
            insert u;
            List<User> lstus = New List<User>();
            Profile p = [SELECT Id FROM Profile WHERE Name='Sales and Marketing - ISS - ISDC Enabled'];
            UserRole ur = [select id from userrole where name='Area - Southeast']; 
            User u2 = new User(Alias = 'newUser', Email='newuser@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.test@infosys.com.prod.backlogs');            
            User u3 = new User(Alias = 'newUser123', Email='newuser123@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.test123@infosys.com.prod.backlogs');           
            User u4 = new User(Alias = 'newUserqwe', Email='newuserqwe@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testqwe@infosys.com.prod.backlogs');
            User u5 = new User(Alias = 'newUserrty', Email='newuserrty@testorg.com',
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testrty@infosys.com.prod.backlogs');
            User u6 = new User(Alias = 'newUserqaz', Email='newuserqaz@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testqaz@infosys.com.prod.backlogs');
            User u7 = new User(Alias = 'newUserxsw', Email='newuserxsw@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testxsw@infosys.com.prod.backlogs');
            User u8 = new User(Alias = 'newUseredc', Email='newuseredc@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testedc@infosys.com.prod.backlogs');
            User u9 = new User(Alias = 'newUserqsc', Email='newuserqsc@testorg.com', 
                               EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                               LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testqsc@infosys.com.prod.backlogs');
            User u10 = new User(Alias = 'newUserzxc', Email='newuserzxc@testorg.com', 
                                EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                                LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testzxc@infosys.com.prod.backlogs');
            User u11 = new User(Alias = 'newUseriop', Email='newuseriop@testorg.com',
                                EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                                LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testiop@infosys.com.prod.backlogs');
            User u12 = new User(Alias = 'newUserghj', Email='newuserghj@testorg.com', 
                                EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                                LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testghj@infosys.com.prod.backlogs');
            User u13 = new User(Alias = 'newUserujn', Email='newuserujn@testorg.com', 
                                EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                                LocaleSidKey='en_US', ProfileId = p.Id,userroleid = ur.id, TimeZoneSidKey='America/Los_Angeles', UserName='first.testujn@infosys.com.prod.backlogs');            
            
            for(User us :[SELECT Id, P_Number__c, IsActive, ManagerId, DelegatedApproverId, Area_Vice_President__c, Director__c, Sr_Sales_Manager__c, Sales_Manager__c,
                          Coach__c, rsbr__c, Sales_Engineer__c, uf__User_Champion__c, Advantage_Program_Rep__c, Indirect_RSM__c
                          FROM User ]) {
                              us.ManagerId = u2.id;
                              us.DelegatedApproverId = u3.Id;
                              us.Area_Vice_President__c = u4.Id;
                              us.Director__c = u5.Id;
                              us.Sr_Sales_Manager__c = u6.Id; 
                              us.Sales_Manager__c = u7.Id;
                              us.Coach__c = u8.Id; 
                              us.rsbr__c = u9.Id; 
                              us.Sales_Engineer__c = u10.Id; 
                              us.uf__User_Champion__c = u11.Id; 
                              us.Advantage_Program_Rep__c = u12.Id; 
                              us.Indirect_RSM__c = u13.Id;
                              lstus.add(us);
                          }
            update lstus;
            Test.startTest();
            DirectRoleService dsr = new DirectRoleService();                
            dsr.deactivateOldUsers();
            Test.stopTest();
        }   
    }    
}
Main class:
---------------
public class PR_Extension {
    public String RECORD_TYPE {get;set;}
    public String FormType {get;set;}
    public String PageIconID {get;set;}
    
    private Contact formContact, queriedContact;
    private Account formAccount, queriedAccount;
    private Credit_Request__c formCreditRequest;
    
    public String tempAccountId {get;set;}
    public String tempContactId {get;set;}
    
    public Boolean queriedAccountBoolean {get;set;}
    public Boolean queriedContactBoolean {get;set;}
    
    //new
    public Boolean inSF1 {get;set;}
    
    //Used for Contact Auto Complete
    public String soql{
        get{
            if (!String.isBlank(tempAccountId))
            {
                return  ('select Number_of_Lines_Req__c, firstname, lastname, Name, Phone, Email, MailingStreet, MailingCity, MailingState, MailingPostalCode, Retail_Store_Number__c, Store_Info__c, Store_Manager__c from Contact WHERE AccountId = \'' + tempAccountId + '\'');
            }
            else
            {
                return ('');
            }
            
        }set;}
    
    
    /*
* Constructor
*/
    public PR_Extension(ApexPages.StandardController stdController)
    {
        PageIconID = '';
        populateExistingObjects();
        createForm();
    }
    
    /*
* Save action
*/
    public PageReference saveprcreditrequest()
    {
        System.debug('inside save function');   
        Boolean isSuccessful = true;
        Savepoint sp = Database.setSavepoint();
        isSuccessful = StoreService.validateStoreNumber(formContact.Retail_Store_Number__c);
        if(isSuccessful){
            if (!String.isBlank(formContact.MailingState))
            {
                formContact.MailingState = formContact.MailingState.toUpperCase();
            }
            
            List<Account> tempAccounts = [Select Id FROM Account where id = :tempAccountId LIMIT 1];
          //RecordType RT = [Select Id, Name, DeveloperName from RecordType where SobjectType = 'Credit_Request__c' AND DeveloperName = :RECORD_TYPE limit 1];
            if (tempAccounts.size() > 0)
            {
                
                formContact.Accountid = tempAccounts[0].id;
                //System.debug('formContact.Accountid : '+formContact.Accountid);
                //formCreditRequest = new Credit_Request__c();
                //formCreditRequest.RecordTypeId=RT.id;
                formCreditRequest.Business_Name__c = tempAccounts[0].id;
            }
            else
            {
                formAccount.BillingStreet = formContact.MailingStreet;
                formAccount.BillingCity = formContact.MailingCity;
                formAccount.BillingState = formContact.MailingState;
                formAccount.BillingPostalCode = formContact.MailingPostalCode;
                
                if(formAccount.id != null){
                    //when creating a new account, if formAccount id is not null reset
                    formAccount.Id = null;
                }
                
                isSuccessful = SObjectService.insertSingleSobject(formAccount);
                
                if(isSuccessful){
                    
                    Account newAccount = [Select Id, name FROM Account where Id = :formAccount.id  LIMIT 1];
                    formContact.Accountid = newAccount.Id;
                    
                    formCreditRequest.Business_Name__c = newAccount.Id;
                }else{
                    Database.rollback(sp);
                    return null;
                }
            }
            
            List<Contact> tempContacts = [Select Id FROM Contact where id = :tempContactId LIMIT 1];
            
            if (tempContacts.size() > 0)
            {
                formCreditRequest.Business_Contact_Name__c = tempContacts[0].id;
            }
            else
            {
                
                if(formContact.id != null){
                    //when creating a new contact, if formContact id is not null reset
                    formContact.id = null;
                }
                
                formContact.Lead_Status__c = 'Credit Request';
                formContact.RSA_Name__c = formCreditRequest.RSA_Name__c;
                formContact.RSA_Dealer_Code__c = formCreditRequest.RSA_Dealer_Code__c;
                
                if(isSuccessful){
                    isSuccessFul = SObjectService.insertSingleSobject(formContact);
                }
                
                if(isSuccessFul){
                    
                    Contact newContact = [Select Id FROM Contact where id = :formContact.id LIMIT 1];
                    formCreditRequest.Business_Contact_Name__c = newContact.id;
                }else{
                    Database.rollback(sp);
                    return null;
                }
            }
            
            if(isSuccessful){
                if(SObjectService.saveResultInsertListProcessErrors(new List<Credit_Request__c>{formCreditRequest}))
                {
                    PageReference p = null;
                    if(!inSF1){
                        p = new PageReference('/'+formCreditRequest.id);
                    }else{
                        p = Page.SF1LeadSuccess;
                    }    
                    //PageReference p = new PageReference('/'+formCreditRequest.id);
                    p.setRedirect(true);
                    return p;
                }else{
                    Database.rollback(sp);
                    return null;
                }
            }
            else
            {
                Database.rollback(sp);
                return null;
            }
        }else{
            //Display the error message
            return null;
        }
    }
    
    /*
* Contact getter
*/
    public Contact getContact() {
        
        return formContact;
    }
    
    /*
* Account getter
*/
    public Account getAccount() {
        
        return formAccount;
    }
    
    // Update SOQL query with accountid
    
    public PageReference updateSOQL(){
        if (!String.isBlank(tempAccountId))
        {
            soql = 'select Number_of_Lines_Req__c,firstname, lastname, Name, Phone, Email, MailingStreet, MailingCity, MailingState, MailingPostalCode, Retail_Store_Number__c, Store_Info__c, Store_Manager__c from Contact WHERE AccountId = \'' + tempAccountId + '\'';
        }
        else
        {
            soql = '';
        }
        
        return null;
    }
    
    // Credit Request getter
    
    public Credit_Request__c getCreditRequest() {
        
        return formCreditRequest;
    }
    
    /*
* Initialize objects
*/
    public void createForm() {
        //get current user
        User currentUser = [select id, SAP_Store_Number__c, Retail_Store_List__c from User where id =: UserInfo.getUserId()];
        System.debug('### Record Type : ' +RECORD_TYPE );
        RecordType crRT = [Select Id, Name, DeveloperName from RecordType where SobjectType = 'Credit_Request__c' AND DeveloperName = :RECORD_TYPE limit 1][0];
        String LinkName = '%' + crRT.Name + '%';
        PageIconID = crRT.DeveloperName;
        FormType = crRT.Name;
        
        formContact = new Contact();
        formContact.LeadSource = 'Walk-In Lead';
        
        //populate store number on load
        formContact.Retail_Store_Number__c = currentUser.SAP_Store_Number__c;
        
        //populate with existing contact if it exists
        if(queriedContact != null){
            formContact.LastName = queriedContact.LastName;
            formContact.FirstName = queriedcontact.FirstName;
            formContact.Retail_Store_Number__c = queriedContact.Retail_Store_Number__c;
            formContact.Email = queriedContact.Email;
            formContact.Phone = queriedContact.Phone;
            formContact.MailingStreet = queriedContact.MailingStreet;
            formContact.MailingCity = queriedContact.MailingCity;
            formContact.MailingState = queriedContact.MailingState;
            formContact.MailingPostalCode = queriedContact.MailingPostalCode ;
            formContact.Number_of_Lines_Req__c = queriedContact.Number_of_Lines_Req__c;
            formContact.LeadSource = queriedContact.LeadSource;
        }
        
        formAccount = new Account();
        //populate with existing account if it exists
        if(queriedAccount != null){
            formAccount.Name = queriedAccount.Name;
        }
        
        formCreditRequest = new Credit_Request__c(RecordTypeId = crRT.id, Channel__c = 'Retail', Submit_for_Approval__c = true);
        
    }
    
    //Populate the existing Account and Contact if they exist
    
    public void populateExistingObjects(){
        String acctId = ApexPages.currentPage().getParameters().get('accountid');
        String contId = ApexPages.currentPage().getParameters().get('contactid');
        
        if (!String.isBlank(ApexPages.CurrentPage().GetParameters().Get('Type')))
        {
            RECORD_TYPE = ApexPages.CurrentPage().GetParameters().Get('Type');
        }
        
        if (!String.isBlank(ApexPages.CurrentPage().GetParameters().Get('mobilelink')))
        {
            inSF1 = (ApexPages.CurrentPage().GetParameters().Get('mobilelink') == 'true')?true:false;
        }else{
            inSF1 = false;
        }
        
        // Referring the Apex class 'CreditRequestService' to fetch related account details
        if(!String.isBlank(acctId)){
            Set<ID> accountIdSet = new Set<ID>();
            accountIdSet.add(acctId);
            Map<ID,Account> accountMap = CreditRequestService.getRelatedAccounts(accountIdSet);
            if(!accountMap.isEmpty()){
                queriedAccount = accountMap.values().get(0);
                tempAccountId = accountMap.values().get(0).id;
                queriedAccountBoolean = true;
            }
        }
        
        // Referring the Apex class 'CreditRequestService' to fetch related contact details
        if(!String.isBlank(contId)){
            Set<ID> contactIdSet = new Set<ID>();
            contactIdSet.add(contId);
            Map<ID,Contact> contactMap = CreditRequestService.getRelatedContacts(contactIdSet);
            if(!contactMap.isEmpty()){
                queriedContact = contactMap.values().get(0);
                tempContactId = queriedContact.id;
                queriedContactBoolean = true;
            }
        }
    }
}
Can anyone help how to stop users from receiving emails by doing changes at user level in salesforce?
Hi,

Is there a way to embed or code to enable lightning-native lookup fields that will give the ability to not only search for the lookup item but will also give the option to create new lookup record if you want to as shown in below image.

User-added image

Thanks in Advance
Can anyone tell me how to add/include Standard New Contact Create link as button in salesforce lightning component?

i,e. When clicking a button on lightning component it should route to Standard Contact creation page.

Thanks in Advance.