• Ruchi Gupta Keshri
  • NEWBIE
  • 30 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 5
    Replies
can someone help me with this
how to list more then 50000 record using Data table in lwc please help.
 
Create fields on Object A :- ObjectA

Request Status (Picklist) :-  New, Approved, Duplicate, Not Matched, Rejected, Completed, Match Found. 

Is Auto Approved (Checkbox) 

Email  

Roles (Multi-Select Picklist) :- Admin, Developer, Manager, CEO, Executive. 

When a record is created for the first time request status is new.  Also Check roles and email existence, 
if already exist then request status is Duplicate. 

Check if contact exists for the email id and if not then create a contact record respective to the email id 
and populate the id to the A object contact field. 

If the Request Status is Completed for the record created , then for another new record (with same email) 
the Request Status should be Approved and Checkbox true. 

i write trigger for above 1st condition.....can any one tell how to write for 2nd and 3rd point. with best practice....

trigger ObjectATrigger on ObjectA__c (before insert,after update) {
    list<String> email= new List<string>();
    list<string> roles= new List<string>();
    list<ObjectA_c> objData= [Select id,Emailc,Rolesc,Request_Statusc from ObjectA_c limit 10];
    if(trigger.isbefore && trigger.isinsert){
    for(ObjectA__c obj:objData){
        email.add(obj.Email__c);
        roles.add(obj.Roles__c);
    }
    for(ObjectA__c objcheck: trigger.new){
        if(email.contains(objcheck.Email_c) || roles.contains(objcheck.Roles_c)){
            objcheck.Request_Status__c='Duplicate';
        }else
           objcheck.Request_Status__c='New'; 
    }
    }
    if(trigger.isafter && trigger.isupdate){
        list<ObjectA_c> objNewRecord= new List<ObjectA_c>();
        for(ObjectA__c objupdate: trigger.old){
            system.debug('objupdate'+objupdate);
            if(objupdate.Request_Status__c == 'Completed'){
                ObjectA_c newobj= new ObjectA_c();
                newobj.Request_Status__c='Approved';
                newobj.Name=objupdate.Name;
                newobj.Is_Auto_Approved__c=true;
                newobj.Email_c= objupdate.Email_c;
                objNewRecord.add(newobj);
                system.debug('objNewRecord'+objNewRecord);
            }
            insert objNewRecord;
         }
    }
}
<template>
    <div>
        <div class="content">
            <img src={order.Picture_Url__c} class="slds-align_absolute-center orderImage"
            alt="Order Picture"/>
            <div>
                <p title class="title slds-align_absolute-center">{order.Name}</p>
                <p class="slds-align_absolute-center">
                    Price:
                    <lightning-formatted-number value={order.Price__c}> </lightning-formatted-number>
                </p>
                <p class="slds-align_absolute-center">Quantity: {order.Quantity__c}</p>
                <p class="slds-align_absolute-center">Return status:{order.Return__c}</p>
                <Lightning-input class="slds-align_absolute-center" type="checkbox" label="Return Order" data-id={order.Id} value={order.Return__c} onchange={handleCheckboxChange}></lightning-input>
            </div>
        </div>
    </div>
</template>

 @api order={};
    selection;
    get disablehandle(){
     //   return()
    }
    handleCheckboxChange(event){
        console.log(event.target.value)
    }
AnyBody Knows What i need to do for returning both object data????
Please Help
Unable to get Account field data it only return Case field data

public class AccountCase {
 @AuraEnabled(cacheable=true)
    public static List<Case> getAccountCaseData(String AccountId){
        
        //List<Case> caseList = new List<Case>();
        List<Case> caseList=[select id,AccountId, Account.Phone, Account.Email__c, Account.Birthdate__c from Case where id=:AccountId];
        system.debug( 'caseList'+caseList);
        return caseList;        
    }
}

OutPut:
caseList(Case:{Id=5005i000007nsdmAAA, AccountId=0015i0000083Bg8AAE})
Hi all, I am doing Salesforce to Salesforce Integration...in Which If i am created and updated Lead in Org A then it will show successfully .i am done with GET,POST,PUT but not able to do Delete..
Callout Class in ORG A
@future(callout=true)
    global static void deleteLeadInSalesforceOrgB(set<Id> setLeIds){
        list<Lead> listLead= [SELECT Name,Company,Status,LeadSource,Phone FROM Lead LIMIT 1];
        system.debug('listLead'+listLead);
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('callout:SFDC_Org_B_Connect/services/apexrest/Leads'+setLeIds);
        request.setMethod('Delete');
        LeadWrapper leWr=new LeadWrapper();
        //leWr.idd =idd;
        request.setBody(JSON.serialize(leWr));
        //request.setHeader('Content-Type','application/json;charset=UTF-8'); 
        HttpResponse response = http.send(request);
        System.debug(response.getBody());
        // If the request is successful, parse the JSON response.
        if (response.getStatusCode() == 200) {
            String jsonStr = '{"feed":{"row_count":1,"items":[{"msg":"<a class=\\"keyword\\" href=http://abc.html>XYZ</a>Clicked<a class=\\"keyword\\" href=http://abc.html>http://abc.html</a>","interest":"Other","whendt":"2012-02-15T18:03:32-08:00"}]}}';
            LeadWrapper results = (LeadWrapper)JSON.deserialize(jsonStr, LeadWrapper.class);
            // for(object result : results){
            System.debug(response.getBody());
        }   
        else{
            system.debug(response.getStatusCode());
        }
    }
trigger condition
if(trigger.isbefore){
        if(trigger.isDelete){
            set<Id> leeIdSet=new set<Id>();
           // for(Lead le:){                
                leeIdSet=trigger.oldMap.keySet();  
                SalesforceConnect.deleteLeadInSalesforceOrgB(leeIdSet);
}}}

rest resource code in ORG B
 @HttpDelete
    global static string deleteLead() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        system.debug('req-->'+req);
        String idd = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        system.debug('idd--->'+idd);
        Lead le = [SELECT ExternalId__c,id FROM Lead WHERE ExternalId__c = :idd LIMIT 1];
      //  le.id=idd;
        //system.debug('le---->'+le);
        delete le;
        return 'success';
    }
Please help me what i do..
@isTest static void testUpsertCase() {
        // 1. Insert new record
        Lead lead1Id = LeadWebService.upsertLead('Test1', 'Tata', 'Working - Contacted','Web','9999999999',null);
        // Verify new record was created
        System.assert(lead1Id != null);
        Lead lead1 = [SELECT Id,LeadSource FROM Lead WHERE Id=:'00Q5i000005Ot9hEAC'];
        System.assert(lead1 != null);
        System.assertEquals(lead1.LeadSource, 'Web');
        // 2. Update status of existing record to Working
        Lead lead2Id = LeadWebService.upsertLead('Test1', 'Tata', 'Open - Not Contacted','Phone Inquiry','9999999999','00Q5i000005Ot9hEAC');
        // Verify record was updated
        System.assertEquals(lead1Id, lead2Id);
        Lead lead2 = [SELECT Id,Status FROM Lead WHERE Id=:'00Q5i000005Ot9hEAC'];
        System.assert(lead2 != null);
        System.assertEquals(lead2.Status, 'Open - Not Contacted');
    }User-added image
can someone help me with this
how to list more then 50000 record using Data table in lwc please help.
 
Create fields on Object A :- ObjectA

Request Status (Picklist) :-  New, Approved, Duplicate, Not Matched, Rejected, Completed, Match Found. 

Is Auto Approved (Checkbox) 

Email  

Roles (Multi-Select Picklist) :- Admin, Developer, Manager, CEO, Executive. 

When a record is created for the first time request status is new.  Also Check roles and email existence, 
if already exist then request status is Duplicate. 

Check if contact exists for the email id and if not then create a contact record respective to the email id 
and populate the id to the A object contact field. 

If the Request Status is Completed for the record created , then for another new record (with same email) 
the Request Status should be Approved and Checkbox true. 

i write trigger for above 1st condition.....can any one tell how to write for 2nd and 3rd point. with best practice....

trigger ObjectATrigger on ObjectA__c (before insert,after update) {
    list<String> email= new List<string>();
    list<string> roles= new List<string>();
    list<ObjectA_c> objData= [Select id,Emailc,Rolesc,Request_Statusc from ObjectA_c limit 10];
    if(trigger.isbefore && trigger.isinsert){
    for(ObjectA__c obj:objData){
        email.add(obj.Email__c);
        roles.add(obj.Roles__c);
    }
    for(ObjectA__c objcheck: trigger.new){
        if(email.contains(objcheck.Email_c) || roles.contains(objcheck.Roles_c)){
            objcheck.Request_Status__c='Duplicate';
        }else
           objcheck.Request_Status__c='New'; 
    }
    }
    if(trigger.isafter && trigger.isupdate){
        list<ObjectA_c> objNewRecord= new List<ObjectA_c>();
        for(ObjectA__c objupdate: trigger.old){
            system.debug('objupdate'+objupdate);
            if(objupdate.Request_Status__c == 'Completed'){
                ObjectA_c newobj= new ObjectA_c();
                newobj.Request_Status__c='Approved';
                newobj.Name=objupdate.Name;
                newobj.Is_Auto_Approved__c=true;
                newobj.Email_c= objupdate.Email_c;
                objNewRecord.add(newobj);
                system.debug('objNewRecord'+objNewRecord);
            }
            insert objNewRecord;
         }
    }
}
Hi all, I am doing Salesforce to Salesforce Integration...in Which If i am created and updated Lead in Org A then it will show successfully .i am done with GET,POST,PUT but not able to do Delete..
Callout Class in ORG A
@future(callout=true)
    global static void deleteLeadInSalesforceOrgB(set<Id> setLeIds){
        list<Lead> listLead= [SELECT Name,Company,Status,LeadSource,Phone FROM Lead LIMIT 1];
        system.debug('listLead'+listLead);
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('callout:SFDC_Org_B_Connect/services/apexrest/Leads'+setLeIds);
        request.setMethod('Delete');
        LeadWrapper leWr=new LeadWrapper();
        //leWr.idd =idd;
        request.setBody(JSON.serialize(leWr));
        //request.setHeader('Content-Type','application/json;charset=UTF-8'); 
        HttpResponse response = http.send(request);
        System.debug(response.getBody());
        // If the request is successful, parse the JSON response.
        if (response.getStatusCode() == 200) {
            String jsonStr = '{"feed":{"row_count":1,"items":[{"msg":"<a class=\\"keyword\\" href=http://abc.html>XYZ</a>Clicked<a class=\\"keyword\\" href=http://abc.html>http://abc.html</a>","interest":"Other","whendt":"2012-02-15T18:03:32-08:00"}]}}';
            LeadWrapper results = (LeadWrapper)JSON.deserialize(jsonStr, LeadWrapper.class);
            // for(object result : results){
            System.debug(response.getBody());
        }   
        else{
            system.debug(response.getStatusCode());
        }
    }
trigger condition
if(trigger.isbefore){
        if(trigger.isDelete){
            set<Id> leeIdSet=new set<Id>();
           // for(Lead le:){                
                leeIdSet=trigger.oldMap.keySet();  
                SalesforceConnect.deleteLeadInSalesforceOrgB(leeIdSet);
}}}

rest resource code in ORG B
 @HttpDelete
    global static string deleteLead() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        system.debug('req-->'+req);
        String idd = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
        system.debug('idd--->'+idd);
        Lead le = [SELECT ExternalId__c,id FROM Lead WHERE ExternalId__c = :idd LIMIT 1];
      //  le.id=idd;
        //system.debug('le---->'+le);
        delete le;
        return 'success';
    }
Please help me what i do..
@isTest static void testUpsertCase() {
        // 1. Insert new record
        Lead lead1Id = LeadWebService.upsertLead('Test1', 'Tata', 'Working - Contacted','Web','9999999999',null);
        // Verify new record was created
        System.assert(lead1Id != null);
        Lead lead1 = [SELECT Id,LeadSource FROM Lead WHERE Id=:'00Q5i000005Ot9hEAC'];
        System.assert(lead1 != null);
        System.assertEquals(lead1.LeadSource, 'Web');
        // 2. Update status of existing record to Working
        Lead lead2Id = LeadWebService.upsertLead('Test1', 'Tata', 'Open - Not Contacted','Phone Inquiry','9999999999','00Q5i000005Ot9hEAC');
        // Verify record was updated
        System.assertEquals(lead1Id, lead2Id);
        Lead lead2 = [SELECT Id,Status FROM Lead WHERE Id=:'00Q5i000005Ot9hEAC'];
        System.assert(lead2 != null);
        System.assertEquals(lead2.Status, 'Open - Not Contacted');
    }User-added image