• Vishal Agrawal 35
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi I am doing the Assign Top Leads to Your Sales Rep Trailhead module >> https://trailhead.salesforce.com/trails/learn-admin-essentials/projects/prioritize-leads-with-einstein-lead-scoring/steps/assign-top-leads-to-your-sales-rep and when clicking on the Verify Step button at the bottom of the page I get an error
Step not yet complete... here's what's wrong:
We can't find criteria and immediate actions for Einstein Scores greater than or equal to 80.


This error message is not accurate as the steps in the process builder are there, however, I suspect the error is actually due to an email that I receive immediately after pressing the Verify Step button, I have copied and pasted the contents of the email below, any advice/help would be appreciated.

Subject: Developer script exception from Honeydew : 'LeadScoreGenerator' for job id '7071t000000V3oh' : Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://eu16.salesforce.com/services/data/v43.0/composite/tree/ScoreIntelligence

ApexApplication <info@jp.salesforce.com>12:03 (9 minutes ago)
to me
Apex script unhandled exception by user/organization: 0051t000000MOhX/00D1t000000DWM6

Failed to invoke future method 'public static void createScoreAndFactors(List<Id>)' on class 'LeadScoreGenerator' for job id '7071t000000V3oh'

caused by: System.CalloutException: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://eu16.salesforce.com/services/data/v43.0/composite/tree/ScoreIntelligence

Class.LeadScoreGenerator.sendRequest: line 130, column 1
Class.LeadScoreGenerator.createScoreAndFactors: line 108, column 1
Q object's Child Object is QLI, related by Master-Detail relationship. OLI has child object OPLI, related by Master-Detail.
I am adding Products against one OLI and it is creating multiple records into OPLI.

Now I want to create PDF of a Q object's record with its related QLI and each QLI Object's OPLI records.

Can anyone help me with Apex Code Please.
Here is the Question


Create an Apex class that implements the Schedulable interface to update Lead records with a specific LeadSource. Write unit tests that achieve 100% code coverage for the class. This is very similar to what you did for Batch Apex.
Create an Apex class called 'DailyLeadProcessor' that uses the Schedulable interface.
The execute method must find the first 200 Leads with a blank LeadSource field and update them with the LeadSource value of 'Dreamforce'.
Create an Apex test class called 'DailyLeadProcessorTest'.
In the test class, insert 200 Lead records, schedule the DailyLeadProcessor class to run and test that all Lead records were updated correctly.
The unit tests must cover all lines of code included in the DailyLeadProcessor class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.


Here is my code so far

global class DailyLeadProcessor implements Schedulable {

    global void execute(SchedulableContext ctx) {
        list<leads>Lead = [select leadSource from lead where isnull= true]
        
         for (Integer i = 0; i < 200; i++) {
            Leads.add(new lead(
                name='Dream force'+i
            ));
        }
        insert Leads;
    }

I am not sure what is wrong here

I'm trying to open a pdf I've saved as a static resource in a new window off a button press.  The idea is to allow different representatives while dealing with customers to be able to pull up the specific form for a policy in a separate window if the need arises to quote directly from it.  At the moment my button code is something like the below just to test, but if anyone has a better idea how, either how to call it or where to save the forms to in the first place. to do it I'm open to suggestion, because the the moment the below is producing the error:

A problem with the OnClick JavaScript for this button or link was encountered:

missing : after property id

 

window.open('/viewStaticResource.apexp?id='+{MG_MAG_Claim__c.FID__c})", '_blank');