Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Shubhashini RajaShubhashini Raja 
Hello Trailblazers!!
I cleared my Admin Certification today. I'm so happy. Thank you so much Trailblazer Community for helping me accomplish this. You guys have responded immediately for every question I posted and thanks a lot for sharing the required materials on topics I need referencing. You guys are amazing. Let's keep Blazing!!

Next prep for "Advanced Admin"
 
Best Answer chosen by Shubhashini Raja
Sakthivel MadeshSakthivel Madesh
Wow.. Congratulation Shubhashini !!

Try this trailmix from trailhead - https://trailhead.salesforce.com/en/users/strailhead/trailmixes/prepare-for-your-salesforce-advanced-administrator-credential

Advanced Administrator Quiz from SalesforceBen Website - https://www.salesforceben.com/certified-advanced-administrator-quiz/
Bob JohnsonBob Johnson 
For the life of me I cannot figure this out.   The Admin Cert 2021 is a simple item but it is acting very buggy for me.   I did the major steps:

1.  Set up new org
2.  Import the CSV to create object
3.  Edited the Dynamic Form as intended (since this is the showcase item of the mini badge)

But it will not complete verification -- each timve giving the message below:

We can’t find the custom object with api name 'Laptop_Warranty'.

NOTE:   Shouldn't it be looking for Laptop_Warranty__c ???  Since it has to be a custom object, is there a bug in the check-for-complete code perhaps?

Did anyone else get stuck on this?


Link:  https://trailhead.salesforce.com/en/content/learn/modules/administrator-certification-maintenance-spring-21/maintain-your-administrator-certification-for-spring21
Course Link (https://trailhead.salesforce.com/en/content/learn/modules/administrator-certification-maintenance-spring-21/maintain-your-administrator-certification-for-spring21)
Best Answer chosen by Bob Johnson
Bob JohnsonBob Johnson
Ok, I finally solved it and I figured out the two problems I had were, and I do not believe they were related. 

1st -- even though I created a new org like the instructions suggest, AND I was using the "Launch" button with that Org selected, because I was logged into two different orgs at the time the "validation" function was clearly going to the right org.  When I started over with a new reboot (no changes at all) and fresh Chrome, the validation now found the object.   Then the error changed to something like "please set your filters correct" (sorry I missed exact error).

I had set the filters correctly on the Active Warranty field -- but because I had messed up the page originally, somehow it got renamed as Laptop_Warranty_Record_Page2.     Once I fixed the name of the page by removing that number, it now successfully completed the challenge.

So:
1.  If you are getting the "cant find object" message, make sure you log out of all sandbox/sf instances and start fresh.
2.  If you are getting an error on the record_detail component, check your page name and make sure it is correct.

Thanks for the replies all. 
Moumita SahaMoumita Saha 
Please help me to resolve the issue I am facing.
Error:
Challenge Not yet complete... here's what's wrong:
The WarehouseCalloutService class does not appear to have run successfully. Make sure that you run this class at least once before attempting this challenge. Since this class is implementing the queueable interface, you may want to wait to ensure that it has processed successfully.
Question:
Synchronize Salesforce data with an external system
Implement an Apex class (called WarehouseCalloutService) that implements the queueable interface and makes a callout to the external service used for warehouse inventory management. This service receives updated values in the external system and updates the related records in Salesforce. Before checking this section, enqueue the job at least once to confirm that it's working as expected.
My Code:
public with sharing class WarehouseCalloutService implements queueable, Database.AllowsCallouts {
    private static final String WAREHOUSE_URL = 'https://th-superbadge-apex.herokuapp.com';
    
    public void execute(QueueableContext context){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint(WAREHOUSE_URL);
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        if(response.getStatusCode() == 200)
        {
            List<Object> externalProducts = (List<Object>) JSON.deserializeUntyped(response.getBody());
            List<Product2> newProducts = new List<Product2>();
            
            for(Object p : externalProducts)
            {
                Map<String, Object> productMap = (Map<String, Object>) p;
                Product2 pr = new Product2();
                pr.Replacement_Part__c = (Boolean)productMap.get('replacement');
                pr.Cost__c = (Integer)productMap.get('cost');
                pr.Current_Inventory__c = (Integer)productMap.get('quantity');
                pr.Lifespan_Months__c = (Integer)productMap.get('lifespan') ;
                pr.Maintenance_Cycle__c = (Integer)productMap.get('maintenanceperiod');
                pr.Warehouse_SKU__c = (String)productMap.get('sku');
                pr.ProductCode = (String)productMap.get('_id');
                pr.Name = (String)productMap.get('name');
                newProducts.add(pr);
            }
            if(newProducts.size() >0)
            {
                upsert newProducts; 
            }
        }   
    }
}
Best Answer chosen by Moumita Saha
Moumita SahaMoumita Saha
Thank you Keiji and Dipojjal for your responses.
I was able to resolve by above code only, just changed the URL from https://th-superbadge-apex.herokuapp.com to https://th-superbadge-apex.herokuapp.com/equipment
Kendra KellyKendra Kelly 
Hi everyone,

I'm having an issue with a workflow rule where I want to update a custom field "Renewal_Date__c" on an Opportunity record, with a custom Opportunity Product field "End_Date__c" when the Opportunity stage is changed to "Delivery Won."

My workflow rule object is the Opportunity Product and the criteria is:

(Opportunity Product: Opportunity Product Name EQUALS Annual Subscription) AND (Opportunity: Stage EQUALS Delivery Won)

The rule evaluates when a record is created, and every time it's edited.

My field to update is Opportunity: Renewal Date and updates with the formula "End_Date__c" (from the Opportunity Product, don't worry, no " " in the actual formula!)

I have made sure my rule is active.

When I add the product "annual subscription" and change the Opportunity Stage to "Delivery Won" nothing happens to "Renewal_Date__c". However, if I change the Opportunity stage "Delivery Won" and THEN add my "annual subscription" Opportunity Product to the Opportunity, the field updates. I orignally figured that is because the field will only update if the Opportunity Product updates since that is my primary object in the workflow rule. However, I added another workflow field update to the same rule, this time on an Opportunity Product field, to arbitrary update the record. Looking at the last modified date on the Opportunity Product, this does update the Opportunity Product record, but it still does not cause my workflow rule to update "Renewal_Date__c" on the Opportunity if the Opportunity Product is added before the Opportunity stage is "Delivery Won."

I'm really hoping this is not a trigger, because while I'd love to write a trigger, I'm not quiet at that level yet. Is this possible with a cross object formula? Am I missing something in the workflow rule?

My end goal is to get a renewal date field on the Account record from the Opportunity Product "End_Date__c". I was planning on Opportunity Product ("End_Date__c") --> Opportunity ("Renwal_Date__c") --> Account ("Account_Renewal_Date__c"), so if that helps with a workaround, great.

I'm not sure why this only works when I add an the "annual subscription" Opportunity Product to the Opportunity when my workflow conditions are already true, but I'm hoping someone can help me out.

​Thank you in advance!
Best Answer chosen by Kendra Kelly
Jeff MayJeff May
You can't control a Parent record based on a value from one of its children, since there would be no way to know which child record the parent criteria should use.

However, you can create a Rollup Summary field on Opportunity that holds the "Max" Date from all the related LineItem records.  Then, your Opportunity Workflow Rule could set an Opportunity field based on the value in that Rollup field.
David HydeDavid Hyde 
i'm trying to update regions in my salesforce org how would i go about that creating report then dataloading what i want updated correct ?
Best Answer chosen by David Hyde
Sandhya V RaoSandhya V Rao
Hi David,

Yes. If you have a lot of regions, then pull all the details (name, code, etc.) on Regions that you want to update along with Salesforce record IDs as a CSV file. Make a copy of the file (for backup), make changes, and data load/update. 

Thanks.
Malisa GibbonsMalisa Gibbons 
I am trying to create a formula to auto populate a date field with today's date when a field (Module Change Flag) is True.  I also want to clear the date field of the box becomes unchecked.
How can I write this?
Best Answer chosen by Malisa Gibbons
Steve MolisSteve Molis
What date are you trying to enter into the Date field?  

If it's the Date that the checkbox field is set to checked/true a Formula(Date) field will not work.  

For that you'd need to use Process Builder, Flow, or a Workflow Rule, triggered when the checkbox field is changed, with 2 immediate Actions:

One to set the Date field to TODAY() when the checkbox is set to TRUE
and
One to reset the Date field to NULL when the checkbox is set to FALSE
Jon SchiavoneJon Schiavone 
Hi Trailblazers,
This is my first post, so please be kind!  I have a pretty straightforward need, but it doesn't appear Salesforce supports this for some reason.  We have an account field for Order Date and I'm trying to create a formula field that calculates the date of the most recent order.  In Excel and SQL, this would simply be MAX(Order_Date), but SF's MAX function only works with numbers and not dates. Is there a way to accomplish this in Salesforce? Am I missing something obvious?  Thank you in advance for any help with this issue.
-Jon
Best Answer chosen by Jon Schiavone
Clara PerezClara Perez

Hi Jon, 

If your you are using the Standard Account and Order objects.
In order to achieve this you will have to write a trigger in Account, or you can also install an appExchange app like RollUp Helper (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000009i3UpEAI) or similar. 

A formula field by it selft will not get you there along.

If your you are using the Standard Account and a Custom Order object.
You might be able to achieve this functionality declaring a Master-Detail relationship between the two object, and then creating a RollUp Summary field on the Account Object using the MAX function

documentation - 
https://help.salesforce.com/articleView?id=fields_about_roll_up_summary_fields.htm&type=5

trailhead - https://trailhead.salesforce.com/en/content/learn/modules/point_click_business_logic/roll_up_summary_fields

Gabriel VieiraGabriel Vieira 
Hi,

I have a Product object with a price field, and a Line Item object that looks up to the Product, and has a number field, to show that X number of Y products have been sold. I want to have a formula field on the Line Item that performs the calculation Number(Line Item Field)xPrice(Product Field). Is it possible to reference a field in another object in this way?

Thanks,
Gabriel
Best Answer chosen by Gabriel Vieira
Stephen NoeStephen Noe
Yes, this is possible.  The syntax for your formula field would look like:
Number__c  * Product__r.Price__c
As a tip, click the 'Insert Field' button to get a window that will help you automatically add fields to your formula in the proper format.
User-added image
力載 髙橋力載 髙橋 

Is there any way to rename stages "closed"?

Best Answer chosen by 力載 髙橋
Mira ShahMira Shah
If you are trying to rename stage "Closed" in path settings;

User-added image

You cannot rename opportunity stage name "closed", but you can make a custom stage (with the name you wish) and then delete the original stage (putting it in the Inactive list).

But, you can also change stage name Closed Won & Closed Lost according below link. 
https://trailblazers.salesforce.com/answers?id=90630000000hMyiAAE
Rico MoyaRico Moya 
How would I create a forumla field that shows each time a value (stage) changes on the field called  "Status" it populates the date of when that occurred. I would create a new field called "Date Status Changed".  
Best Answer chosen by Rico Moya
Azfer PervaizAzfer Pervaiz
User-added image
please refer to the above image.