• Anuj kumar rai
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
This is my apex method that is returning a list:
@AuraEnabled(cacheable=true)
    public static List<String> getTypePicklistValuesMethod(){
        List<String> pickListValuesList= new List<String>();
         Schema.DescribeFieldResult fieldResult = Task.Type.getDescribe();
         List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
         for( Schema.PicklistEntry pickListVal : ple){
             pickListValuesList.add(pickListVal.getLabel());
         }    
         return pickListValuesList;
    }

and this is my JS file:
import { LightningElement, wire} from 'lwc';
import picklistValues from '@salesforce/apex/TaskCreator.getTypePicklistValuesMethod';

export default class ListToMapPractice extends LightningElement
{
    @wire(picklistValues)
    typeValues;
}

So can this "typeValues" be directly used as an array or is there something more to it that i don't know yet.