function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Johan WesterholmJohan Westerholm 

Lightning Experience Specialist - Superbadge - Step 3 - Fullfillment Creation

Hi All!

Have been struggeling with this challange for some time now, 

I´m stuck @ this step

"Update the related Opportunity to reflect the waiver and insurance needs on the Adventure.
Set the 'Needs Insurance' field on the Opportunity to match the 'Needs Insurance' field on the Adventure record.
Set the 'Needs Waiver' field on the Opportunity to match the 'Needs Waiver' field on the Adventure record."

I dont understand how I can do this, is it possible to select the Needs Waiver and Needs Insurance from the Opportunity record here? I´m not able to.
NagendraNagendra (Salesforce Developers) 
Hi Johan,

May I suggest you please check with below data model using which I solved this challenge.
Object - Adventure Package
Start Process- Only when a record is created 

FIRST NODE 

Define Criteria for this Action Group 

Criteria for Executing Actions - Conditions are met 

Set Conditions:

1. [OpportunityLineItem].Oppotunity.StageName Does not equal Cancelled 
2. [OpportunityLineitem].Fulfillment_Created_c Equals False

Conditions - All of the conditions are met (AND) 

IMMEDIATE ACTIONS 

1. Create a Record 

Record Type - Fulfillment 

Set Field Values 

AdventurePackageId -  Reference -[OpportunityLineItem].Id
Adventure Package cost - Reference - [OpportunityLineItem].TotalPrice 
Adventure - Reference -  [OpportunityLineItem].Product2Id
Expedition Leader - Reference -[OpportunityLineItem].Product2.Expedition_Leader_c
Explorer - Reference - [OpportunityLineItem].Explorer_C
Fulfillment Name - Formula -[OpportunityLineItem].Product2.Name + [OpportunityLineItem].Id
Schedule Date -Reference - [OpportunityLineItem].ServiceDate
Status- Picklist - New 
Package -  [OpportunityLineItem].OpportunityId

2. Update Records

Record - [OpportunityLineItem].Opportunity ID 

No criteria just update records 

Set new fields for the records you update 

Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c

3. Update Records 

Record - [OpportunityLineItem]

Criteria for Updating Records - No criteria-just update records 

Set new field values for the records you update 

Fulfilment Created = True 
Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c


Evaluate the Next Criteria 

 SECOND NODE 


EVALUATE THE NEXT CRITERIA 

Define Criteria for this Action Group 

Criteria for Executing Actions - Conditions are met 

Set Conditions:

1. [OpportunityLineItem].Explorer_c   Is Null  = True 

Conditions - All of the conditions are met (AND)

IMMEDIATE ACTIONS 

Create a Record - Task 

Set Field Values

Assigned to ID - reference- [OpportunityLineItem].Opportunity.OwnerId
Related to ID - reference -[OpportunityLineItem].Opportunity.Id
Priority - Normal 
Status - Not started 
Subject- String - Update explorer 

SCHEDULED ACTIONS 

14 days from now 

Post to Chatter 

User - Select a user from a record - [OpportunityLineItem].Opportunity.Owner.Id

Message:

{![OpportunityLineItem].Opportunity.Name}

{![OpportunityLineItem].Product2.Name}

{![OpportunityLineItem].Id}

Once done with these changes, execute blow lines of code in dev console.

Product2 product = new Product2(name='Half Dome Hike', isActive=true); 
insert product; 
//insert the pricebookentry 
Pricebook2 stdPrice = [Select id from Pricebook2 where isStandard=true limit 1]; 
PricebookEntry pbe = new PricebookEntry( IsActive = true, Product2Id = product.id, UnitPrice = 2.00, Pricebook2Id = stdPrice.Id); 
insert pbe;
Hope this helps.

Please mark this as solved if this helps.

Thanks,
Nagendra
 
Johan WesterholmJohan Westerholm
Hi!
 
Thank you for the help!
 
I was able to complete the following step
 
2. Update Records
 
Record - [OpportunityLineItem].Opportunity ID
 
No criteria just update records
 
Set new fields for the records you update
 
Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c
 
But the next step I get stuck on.
 
3. Update Records 
 
Record - [OpportunityLineItem]
 
Criteria for Updating Records - No criteria-just update records
 
Set new field values for the records you update
 
Fulfilment Created = True
Needs Insurance - Reference- [OpportunityLineItem].Product2.Needs_Insurance_c
Needs waiver - Reference -  [OpportunityLineItem].Product2.Needs_Waiver_c”
 
The Needs Insurance and Needs Waiver fields can’t be selected for the OpportunityLineItem, any advice?
 User-added image
  
Also for Step 1 Fulfilment I’m missing Package field should I add this and with what data?  -  [OpportunityLineItem].OpportunityId
Package -  [OpportunityLineItem].OpportunityId
 
Thankful for more help with this tricky badge. 
 
Best Regards,
Johan
Gaurang dadheechGaurang dadheech
Same Question Johan, everyone else whom i asked they all have that package field outtanowhere .
Also i am not able to select needs waiver and needs insurance.
please let me know if you complete the task.

thanks
Shabista Zaidi 5Shabista Zaidi 5
I cleared the challenge after these updates, also use one node it works fine:

1. If you are not able to see Package field ,  Use 'Opportunity' field instead of Package .
    Opportunity-Field Reference-[OpportunityLineItem].Opportunity.
   It works for me after adding this to Create Fulfillment Step. 
2. Also , its ok if you dont see 'needs waiver and needs insurance' on OpportunityLineItem, go ahead with just Fulfilment Created = True.
3. Lastly, under task creation step check this reference onec again for Related Id. It should be Related to ID - reference -[OpportunityLineItem].Opportunity.Id