• Salesforce Dev199
  • NEWBIE
  • 20 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
How can we pass 10000 records from Apex class to batch class and update 10000 records of Sobect type lead & contact Opps.

I'm trying to change the owner of 10000 records. so I've created a lwc, where I'll take the user from 1st dropdown  of which user record will need to transfer, 2nd drop down will be to which user it should transfer.

Let me know how i can achieve this
Hello Everyone,
I've a lightning out app, and added this app in salesforce "Sites".
I'm not receiving any emails as I'm supposed to receive based on some action in the lwc app placed in lightning app. 
I've given the apex class permission to Guest site user. In debug log I checked the status of email is success = true.. still I'm not able to receive emails.
Can anyone know what extra pernission should we give in order to receive emails from Guest site user?
Hello Experts,

I dont find any standard documentation on importing custom object and its field to import in lwc js.

Like how do we even import custom obect's picklist and show them on frontend? 

Can anyone help me with this?
Hello All,

Can I get the solution for the error: 

EXCEPTION_THROWN [11]|System.CalloutException: The URI is invalid.
This error is thrown when the endpoint URL has special characters like in query there is * and > symbol so it is not acceptable as proper endpoint URL.
Below is the code for the endpoint URL 
In one of the  POST (https://trailblazer.salesforce.com/issues_view?id=a1p4V000001JkjTQAS), it says special characters in URI are not working after Spring 21.
 
String query='select * from Invoice where Metadata%2ECreateTime > \'2021-06-01T03:58:32.968-07:00\'';
req.setEndpoint('callout:SalesforceQB_Production'+'/v3/company/xxxxxxxxxx/query?query='+query+'&minorversion=59');

Any integration experts here?
 
Can anyone help me how to write a test class for REST API? below is my code.. Please help guys.
@RestResource(urlMapping='/Course__c/*')
global class WebServiceExpose
{
    
    public String Name;
    public String sectionKey;
    public String profkey;
    public String schoolKey;
    public String Group1;
    public String coursecreated;
    public String startDate;
    public String endDate;
    public Double Prod_Capsim360;
    public Double Prod_GlobalDNA;
    public static WebServiceExpose parse(String Json)
    {
        return (WebServiceExpose) System.JSON.deserialize(json, WebServiceExpose.class);
    }
    
    @HttpPost
    global static ID doPost()
    {
        RestRequest req = RestContext.request;
        Blob body = req.requestBody;
        String requestString = body.toString();
        
        WebServiceExpose we= (WebServiceExpose)JSON.deserialize(requestString, WebServiceExpose.class);
        System.debug('-->>'+we);
        String Name1=we.Name;
        String sectionKey1=we.sectionKey;
        String profkey1=we.profkey;
        String Group1=we.Group1;
    	Date coursecreated=Date.valueOf(we.coursecreated);
        Datetime startDate=Date.valueOf(we.startDate);
        Datetime endDate=Date.valueOf(we.endDate);
        String schoolkey1=we.schoolKey;
        Double Prod_Capsim360c=we.Prod_Capsim360;
        Double Prod_GlobalDNA1=we.Prod_GlobalDNA;
        List<Contact> con=new List<Contact>();
		con=[select id, Professor_Key__c,Contact.AccountId from Contact where Professor_Key__c=: profkey1 LIMIT 1];
		System.debug('-'+con);       
        List<AccountContactRelation> accon=new List<AccountContactRelation>();
        accon=[select contactId, accountId,account.School_Key__c from AccountContactRelation where account.School_Key__c=: schoolkey1];
        
        
        Course__c course=new Course__c(Name=Name1, Contact__c=con[0].Id, Account__c=accon[0].AccountId, Group__c= Group1, Course_Created_Date__c=coursecreated,End_Date__c= endDate, Start_Date__c=startDate, Prod_Capsim360__c= Prod_Capsim360c,Prod_GlobalDNA__c=Prod_GlobalDNA1,Section_Key__c=sectionKey1);
		insert course;
        System.debug('Course details '+course);
        return course.Id;
    }
    
   
    //public String sectionKey;
    public String studentcount;
    
     @HttpPatch
//Method to update Course fields
global static ID updateRecord()
{
    RestRequest req = RestContext.request;
    Blob body = req.requestBody;
    String requestString = body.toString();
    
    WebServiceExpose we= (WebServiceExpose)JSON.deserialize(requestString, WebServiceExpose.class);
    String sectionKey1=we.sectionKey;
    String studentcount1=we.studentcount;
    
    List<Course__c> course1= new List<Course__c>();
    course1=[select id, Section_Key__c, Number_of_Students__c From Course__c where Section_Key__c= :sectionKey1 ];
    
    course1[0].Number_of_Students__c=Integer.valueOf(studentcount1);
    update course1;
    
    
    return course1[0].id;
}

    
}

 
Hello Everyone, Can You guys help me with a test class for this Controller of Lighning page.
public class SendForSignController {
	@AuraEnabled	
    public static MessageWrapper performValidation(String oppoRecId) {
        MessageWrapper returnwrapperClass = new  MessageWrapper (); 
        List<Opportunity> oppoRecordList = [Select id,
                                                    name,
                                                    AccountId,
                                                    Account.Customer_Success_Manager__c,
                                                    (
                                                        SELECT Id,
                                                            Name,
                                                            Ready_for_Approval__c
                                                        FROM 
                                                            zqu__Quotes__r
                                                        WHERE Ready_for_Approval__c = true
                                                        limit 1
                                                    ) 
                                                  FROM Opportunity WHERE Id = :oppoRecId ];
        System.debug('oppo record::'+oppoRecordList[0]);
        System.debug('oppo record::'+oppoRecordList[0].zqu__Quotes__r);
        
        if(oppoRecordList != NULL && !oppoRecordList.isEmpty()){
            if(oppoRecordList[0].Account != NULL &&  oppoRecordList[0].Account.Customer_Success_Manager__c != NULL){
                System.debug('Customer success manager of account is not blank'+oppoRecordList[0].Account.Customer_Success_Manager__c);
                if(oppoRecordList[0].zqu__Quotes__r != NULL && oppoRecordList[0].zqu__Quotes__r.size()>0){
                    if(oppoRecordList[0].zqu__Quotes__r[0].Ready_for_Approval__c == true){
                        if(){
                            returnwrapperClass.msgStr = 'Validations Successful..Redirecting to the Page.';
                            returnwrapperClass.msgType = 'success';
                            return returnwrapperClass;
                        }
                    }
                    else{
                         returnwrapperClass.msgStr = 'Validations failed..Cannot Redirect to the Page.';
                         returnwrapperClass.msgType = 'error';
                         return returnwrapperClass;
                    }
                    
                }
            }
            
        }
        return returnwrapperClass;
    }
    
    /*Error Wrapper Class*/
    public class MessageWrapper{
        @AuraEnabled public String msgStr {get;set;}
        @AuraEnabled public String msgType {get;set;}
    }
}

 
Hey guys, 

I want to validate a url Button! that is, Before clicking Quick Action Button, I want  to check few fields are null or not! How can we achieve through lightning Component?
 
How can we pass 10000 records from Apex class to batch class and update 10000 records of Sobect type lead & contact Opps.

I'm trying to change the owner of 10000 records. so I've created a lwc, where I'll take the user from 1st dropdown  of which user record will need to transfer, 2nd drop down will be to which user it should transfer.

Let me know how i can achieve this