• Abhinav Singh
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {
List<task> carry=New List<task>();

  for(opportunity opp:trigger.new){
   if(opp.stagename=='closed own'){
    task t=new task(whatid=opp.id);
    carry.add(t); 
    }
   }
     insert carry;

 }

 The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be 'Follow Up Test Task'.The Apex trigger must be called 'ClosedOpportunityTrigger'
With 'ClosedOpportunityTrigger' active, if an opportunity is inserted or updated with a stage of 'Closed Won', it will have a task created with the subject 'Follow Up Test Task'.
To associate the task with the opportunity, fill the 'WhatId' field with the opportunity ID.
This challenge specifically tests 200 records in one operation.

I tried with the above code, task is not created.
I was solving this challenge and my VF code is:

<apex:page standardController="Account" recordSetVar="Accounts" >
    <apex:pageblock>
        <apex:repeat var="a" value="{!Accounts}" rendered="true"  id="account_list">
            <li>
                <apex:outputLink value="https://ap1.salesforce.com/{!a.ID}" >
                    <apex:outputText value="{!a.Name}"/>
                </apex:outputLink>
            </li>
        </apex:repeat>
    </apex:pageblock>
</apex:page>

I am getting the list of accounts as required and on clicking on any of the accouts, it redirects to that accounts detail page.
Still I am getting following error from trailhead:

"The page does not bind to the record ID value (in order to link to the record detail page)"
Hello All,

I keep getting this error on this question:

Challenge not yet complete... here's what's wrong: 
An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated.

Screenshot:
https://www.dropbox.com/s/30lrmgz8zogxulf/Screenshot%202015-03-23%2016.09.38.png?dl=0

Screenshot 2:

https://www.dropbox.com/s/5wrdht63l18591b/Screenshot%202015-03-23%2016.10.57.png?dl=0

I have gone over this many times and I would appreciate any help to get through this challenge!!


Thanks!