• Dheeraj shokeen
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 3
    Replies
anyone idea about, never expire access token in salesforce , or create own token in salesforce
Test Class code Coverage Working fine but i manot able to achieve the 75% code coverage
so issue is My code have multiple of condition so how to acheieve it.

@isTest
public class LeadReceiver_Test {
    
 @isTest static void Unit_Phone()
  {
      List<Lead>listl = new list<Lead>();
      Profile p = [SELECT Id FROM Profile WHERE Name='System Administrator']; 
            User usr = new User(Alias = 'standt', Email='Dheeraj@gmail.com', 
                        EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
                        LocaleSidKey='en_US', ProfileId = p.Id, 
                        TimeZoneSidKey='America/Los_Angeles', UserName='Dheeraj1@testorg.com');
            insert usr ;
     Account acc = new account();
      acc.name='XYZ1';
      acc.phone='123456';
      Insert acc;
      contact ac = new contact();
      ac.firstname='test';
      ac.LastName='Sharma';
      ac.Email='d@example.com';
      ac.AccountId=acc.Id;
      ac.MailingStreet='Test';
      ac.MailingCity='test';
      ac.MailingCountry='United States';
      ac.MailingPostalCode='12345';
      ac.MailingState='Florida';
      insert ac;
      
      RestRequest request = new RestRequest();
      request.requestURI=  URL.getSalesforceBaseUrl().toExternalForm()+'/Services/Apexrest/PostLead/';
      request.httpmethod='POST';
      request.addheader('Content_Type','Application/json');
      request.addheader('Accept','Application/json');
      Lead lr = new lead(firstname='test record1',Lastname='test1',Title='Mr.',Email='dd8@example.com',Company='test1',Street='test1',City='test',State='ohio',phone='122333',Description='test Class1',
                        PostalCode='12345',Country='United states',Language__c='English',Status='New',NumberOfEmployees=12,SIC_Code__c='1234',LeadSource='Website',Website='www.test1.com',OwnerId=usr.Id,
                        Lead_Num__c='12356',Campaign_Name__c='Website1',Campaign_Initiative__c='Website1',Project_Number__c='Website1',Sales_Representative_Name__c='Website1',
                        Persona__c='Website');
     Insert lr;
      String bodyStr='[{"Sendtoemail":"'+usr.Email+'","LeadStatus":"New","FirstName":"test1","LastName":"Sharma1","Title":"MR","Company":"XYZ","Phone":"123456","Email":"dd@example.com","Street":"Test","City":"test","State":"California","Country":"United States","ZipCode":"12345","Website":"www.gmail.com","Description":"test class","SIC":"123","noOfEmployees":"122","LeadSource1":"Website","LUID":"1234","LeadSource2":"Website","LeadSource3":"Website","LeadSource4":"Website","RepName":"test rep","Persona":"Test is test","SalesforceID":"'+lr.id+'"}]';
      string requestbody = JSON.serialize(listl);
      request.requestbody=Blob.valueof(bodyStr);
      RestContext.request = request;
      LeadReceiver.dopost();
      //List<LeadReceiver.LeadRecord>listrec = new List<LeadReceiver.LeadRecord>(listl); 
  }
 
I try to download the package in my Vlocity org so i m getting error
if anyone please help me how to sortout this problem

here is the below package download link - https://login.salesforce.com//packaging/installPackage.apexp?p0=04t5c000001Zb6YAAS


This package can’t be installed.
There are problems that prevent this package from being installed.
Can't install the package. This package uses old Order Save Behavior and can't be part of orgs that use new Order Save Behavior. For more information, review the Winter '21 Order Save Behavior documentation, or contact the package's developer.
Github configure step in IDX Workbnech? Please provide me the step

User-added image
 
How can resolve this Invalid Grant acces?
password combination are correct  Password+resttoken

But getting error? anyway find that issue
 
Anyone any idea, how to upload the excel data into salesforce object through LWC not for dataloader
Below the Code
public class DynamicRecordEditFormController {
    @AuraEnabled(cacheable=true)
    public static List<Schema.FieldSetMember> getFields(String fieldSetName, String objectName) {
        Schema.SObjectType sObjectType = Schema.getGlobalDescribe().get(objectName);
        Schema.FieldSet fieldSet = sObjectType.getDescribe().fieldsets.getMap().get(fieldSetName);
        return fieldSet.getFields();
    }
}
A - Grant Parent
B-Parent
C- Child

Is there any logic to direclty 
Grand parent send the record to child
Status Code :    500
Error Response :    [{"errorCode":"APEX_ERROR","message":"System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate Lead record. We recommend you use an existing record instead.: []\n\nClass.LeadReceiver.doPost: line 13, column 1"}]
Github configure step in IDX Workbnech? Please provide me the step

User-added image
 
Status Code :    500
Error Response :    [{"errorCode":"APEX_ERROR","message":"System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate Lead record. We recommend you use an existing record instead.: []\n\nClass.LeadReceiver.doPost: line 13, column 1"}]