public with sharing class lexLastbuyProductController { @AuraEnabled public static InitData initForCBLBPNew(String recordId){ InitData res = new InitData(); try { Product2 pro = [ select Name from Product2 where Id =: recordId ]; res.name = pro.Name; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } class InitData{ @AuraEnabled public String name; } }