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
Mohammad Shahid ShahMohammad Shahid Shah 

Advanced Apex Specialist step 1

 I''m struck on Step 1 

User-added imageHere's my code ):
Can someone please help me out !

User-added image
Best Answer chosen by Mohammad Shahid Shah
mukesh guptamukesh gupta
Hi Shaid,

Please use below code:-
 
public class Constants {
    public static final Integer DEFAULT_ROWS = 5;
    public static final String SELECT_ONE = Label.Select_One;
    public static final String INVENTORY_LEVEL_LOW = Label.Inventory_Level_Low;
    public static final List<Schema.PicklistEntry> PRODUCT_FAMILY = Product2.Family.getDescribe().getPicklistValues();
    public static final String DRAFT_ORDER_STATUS = 'draft';
    public static final String ACTIVATED_ORDER_STATUS = 'activated';
    public static final String ERROR_MESSAGE = 'An error has occurred, please take a screenshot with the URL and send it to IT.';
    public static final Id STANDARD_PRICEBOOK_ID = '01s3k000002IjuwAAC';
}

For the STANDARD_PRICEBOOK_ID, use the below query in Query editor and grab the id.
SELECT Id FROM PriceBook2 WHERE Name = 'Standard Price Book'

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

All Answers

ShivankurShivankur (Salesforce Developers) 
Hi Shahid,

Please note that Questions about how to pass Trailhead challenges are not on topic, because these challenges are intended to be independent demonstrations of your abilities.

Trailhead Help (https://trailhead.salesforce.com/en/help?support=home)can provide assistance for situations where Trailhead does not appear to be functioning correctly. You can reach out to them if this is the case.

Hope above information helps.

Thanks.
mukesh guptamukesh gupta
Hi Shaid,

Please use below code:-
 
public class Constants {
    public static final Integer DEFAULT_ROWS = 5;
    public static final String SELECT_ONE = Label.Select_One;
    public static final String INVENTORY_LEVEL_LOW = Label.Inventory_Level_Low;
    public static final List<Schema.PicklistEntry> PRODUCT_FAMILY = Product2.Family.getDescribe().getPicklistValues();
    public static final String DRAFT_ORDER_STATUS = 'draft';
    public static final String ACTIVATED_ORDER_STATUS = 'activated';
    public static final String ERROR_MESSAGE = 'An error has occurred, please take a screenshot with the URL and send it to IT.';
    public static final Id STANDARD_PRICEBOOK_ID = '01s3k000002IjuwAAC';
}

For the STANDARD_PRICEBOOK_ID, use the below query in Query editor and grab the id.
SELECT Id FROM PriceBook2 WHERE Name = 'Standard Price Book'

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
This was selected as the best answer
Mohammad Shahid ShahMohammad Shahid Shah
Hi @Mukesh !
Thanks for your help..Issue resolved .
KONA AKHILA LAKSHMI SRAVANIKONA AKHILA LAKSHMI SRAVANI
Getting an same error even after xhangign the code
 
siva vithanalasiva vithanala
Thank you Mukesh it is working perfect 👌.