• shradha mhaske
  • NEWBIE
  • 10 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hello,

I'm trying to complete the Simulate a Cross-Site Scripting Attack but I get the error:

Challenge Not yet complete... here's what's wrong: 
It doesn't appear that you've successfully simulated a cross-site scripting attack using the Visualforce page. Please try again.

My input is: <a onmouseover = "alert(\'This is an xss attack.\')">xss attack</a>
The org is connected to Trailhead, however, it seems that the Trailhead Tracker isn't installed. Isn't this package usually required to track access the orgs used in Trailhead?
For the above qus I wrote the below code : 

trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {

List<Task> t1=new List<Task>();


for (opportunity a :[select ID,StageName  from opportunity where StageName='Closed Won' and ID IN :Trigger.New])
{


t1.add(new Task(subject= 'Follow Up Test Task', WhatId=a.ID));

if(t1.size() >0 && t1.size()<=200)
{
insert t1;
}
}
}



But getting a error like   :
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, trig_conts_opprty: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0 with id 0032800000QkI6aAAF; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id] Trigger.trig_conts_opprty: line 10, column 1: []


Anyone please tell me the possible reason for the error ?
global class LeadProcessor implements 
    Database.Batchable<Leads>, Database.Stateful {
//     Database.Batchable<Sobject>, Database.Stateful {

    
    // instance member to retain state across transactions
    global Integer recordsProcessed = 0;

    global Database.QueryLocator start(Database.BatchableContext bc) {
        return Database.getQueryLocator([Select LastName From Leads ]);

     }
          
    }

    global void execute(Database.BatchableContext bc, List<Leads> scope){
        // process each batch of records
        List<Leads> leads = new List<Leads>();
            for (Leads:leads) {
                Leads.LeadSource = Dreamforce;
                // add Leads to the list to be updated
                leads.add(leads);
                // increment the instance member counter
                recordsProcessed = recordsProcessed + 1;
            }
        }
        update leads;
    }    

    global void finish(Database.BatchableContext bc){
        System.debug(recordsProcessed + ' records processed. Shazam!');
        AsyncApexJob job = [SELECT Id, Status, NumberOfErrors, 
            JobItemsProcessed,
            TotalJobItems, CreatedBy.Email
            FROM AsyncApexJob
            WHERE Id = :bc.getJobId()];
        // call some utility to send email
        EmailUtils.sendMessage(a, recordsProcessed);
    }    

}
Challenge Description:
  • Upload a specified zip file as a static resource. The zip will have directories with images and you have to display a specific image on a Visualforce page.The page must be named 'ShowImage'.
  • This file must be uploaded as a Static Resource named 'vfimagetest'.
  • The page must have a Visualforce apex:image tag that displays the 'kitten1.jpg' image from the 'cats' directory of the static resource.

Screenshot of Visualforce Page:
User-added image
Screenshot of Resource Page:
User-added image

Screenshot of page preview:
User-added image

Exact text of error:
Challenge not yet complete... here's what's wrong: 
The page does not include a reference to the specified image

Can't figure out whats wrong, everything looks like its working perfectly and I used the examples in the module as a base for the code.

Hi, 

I have a code written in Visualforce - developer console page, but it's not displaying any preview nor allowing me to pass the challenge -  I assume that I've made some error on this..
 
The task given for this challenge as follows:

Create a Visualforce form which inserts a basic Contact record

Using the Visualforce apex:form component, create a page which will insert a Contact record based on First Name, Last Name and Email. After submitting the form, the user should be redirected to detail page of the new Contact record.The page must be named 'CreateContact'.
  • It must reference the Contact standard controller.
  • It must use a Visualforce apex:form component.
  • It must have an apex:inputField component bound to the Contact First Name.
  • It must have an apex:inputField component bound to the Contact Last Name.
  • It must have an apex:inputField component bound to the Contact Email.
  • It must have an apex:commandButton component that uses the 'save' method from the standard controller.
Please help me to resolve this problem.. Thanks in advance

User-added image