• Michael Peddycord
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies
Hello everyone! On the Bulk Apex Triggers Trailhead, I'm getting the error "Error Occurred: This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [Name]." in flow error emails. Can anyone help me troubleshoot this issue?

See below:
Flow Details
Flow Name: Renew_Opportunity
Type: Autolaunched Flow
Version: 1
Status: Inactive

Flow Interview Details
Interview Label: Renew Opportunity 4/11/2018 1:43 PM
Current User: Michael Peddycord (0056A000001jOSN)
Start time: 4/11/2018 1:43 PM
Duration: 0 seconds

How the Interview Started
Michael Peddycord (0056A000001jOSN) started the flow interview.

ASSIGNMENT: Update_Opportunity_Fields
{!opportunity.StageName} Equals Prospecting
{!opportunity.CloseDate} Equals {!ninetyDays}
Result
{!opportunity.StageName} = "Prospecting"
{!opportunity.CloseDate} = "July 10, 2018"

FAST CREATE: Clone_Opportunity
Create Opportunity records using the values that are stored in {!opportunity}.
Variable Values
[StageName=Prospecting,CloseDate=7/9/2018 5:00 PM]
Result
Failed to create records.

Error Occurred: This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [Name]. For details,
Hello everyone! On the Bulk Apex Triggers Trailhead, I'm getting the error "Error Occurred: This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [Name]." in flow error emails. Can anyone help me troubleshoot this issue?

See below:
Flow Details
Flow Name: Renew_Opportunity
Type: Autolaunched Flow
Version: 1
Status: Inactive

Flow Interview Details
Interview Label: Renew Opportunity 4/11/2018 1:43 PM
Current User: Michael Peddycord (0056A000001jOSN)
Start time: 4/11/2018 1:43 PM
Duration: 0 seconds

How the Interview Started
Michael Peddycord (0056A000001jOSN) started the flow interview.

ASSIGNMENT: Update_Opportunity_Fields
{!opportunity.StageName} Equals Prospecting
{!opportunity.CloseDate} Equals {!ninetyDays}
Result
{!opportunity.StageName} = "Prospecting"
{!opportunity.CloseDate} = "July 10, 2018"

FAST CREATE: Clone_Opportunity
Create Opportunity records using the values that are stored in {!opportunity}.
Variable Values
[StageName=Prospecting,CloseDate=7/9/2018 5:00 PM]
Result
Failed to create records.

Error Occurred: This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [Name]. For details,
Hello Community,
 I'm Working on the Bulk Apex Triggers Trailhead and its throwing me the following error.
Question:
Create an Apex trigger for Opportunity that adds a task to any opportunity set to 'Closed Won'.
To complete this challenge, you need to add a trigger for Opportunity. 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.
Here is my code:
trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {
    List<task> tasktoInsert = new List<task>();
    for(Opportunity opp : Trigger.New){
        if(opp.stageName == 'Closed Won'){
        Task t = new task();
        t.subject = 'Follow Up Test Task';
         t.WhatId = 'opp.Id';
            tasktoInsert.add(t);
        }
    }
    if(tasktoInsert.size()>0) {
        insert tasktoInsert ;
    }
}

 Error:
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, ClosedOpportunityTrigger: execution of AfterInsert caused by: System.StringException: Invalid id: opp.Id Trigger.ClosedOpportunityTrigger: line 7, column 1: []

Hope you guys can help me.
Thanks in advance,
Mounika.