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
Nisha RadhaNisha Radha 

How to pass parameter of type enum?

Season southernHemisphereSeason = Season.WINTER;

public Season getSouthernHemisphereSeason(Season northernHemisphereSeason) {

    if (northernHemisphereSeason == Season.SUMMER) return southernHemisphereSeason;
     //...
}

This is a sample code I found in Salesforce.developer.com. How do I call the method getSouthernHemisphereSeason as it accepts parameter of type Season? When I tried am getting error variable season is not defined
Suraj Tripathi 47Suraj Tripathi 47
Hi Nisha Radha,
Please refer to the below link, hope it will help you -

https://salesforce.stackexchange.com/questions/360869/how-do-i-pass-a-parameter-which-is-of-type-enum-to-a-method

Please mark it as the best answer, if it helps.
Thanks!
Nisha RadhaNisha Radha
That solution also gave me the same error, variable season not defined