Below is my controller and Visualforce page. In this i am trying to remove the Harcoded string. i am getting value in s1.Name. But from the salesforce i have to write the name like ReadyWidth only. If i Write like READYWIDTH then its not working. So any idea how can i remove this hardcoded string value and make it work with lowe and uppercase both?


Map<String, String> sp = new Map<String, String>();  

List<ServiceProgram__C> s = [SELECT  name,Length__c, Width__c from ServiceProgram__C where E_Product__c = :ci.ccrz__Product__r.id];



          returnObject.put('servicePrograms', sp);

Visual Force:-

        else if (valChanged == 'ReadyWidth') {

          var allowances = $("#ReadyWidth").val();
          var parts = allowances.split(":");
          var lengths = parts[0].split(",");
          var widths = parts[1].split(",");
          $.each(lengths, function (i, item) {
                            $('#rollLengthDD').append($('<option>', { 
                                value: item,
                                text : item 

1 Answer 1


You can create a custom label in your Org and then refer that label in your VF page using $Label.CustomLabel where customlabel is the label you created.

You can refer the same custom label in Apex using System.Label.CustomLabel

You can ignore the Case using String.equalsIgnoreCase("String")

Please refer How to use Custom Labels in Visualforce page and Apex Class for more details

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .