public with sharing class lexCopyProductController { public lexCopyProductController() { } @AuraEnabled public static InitData init(String recordId){ InitData res = new InitData(); try { List rl=[select Name,Product_Set_CD__c,Applicable_Department__c,Product_category__c,Valid_Date__c,Invalid_Date__c,Quote_Select_Info__c,Description__c from Product_Set__c where id = :recordId]; res.name=rl[0].Name; res.ProductSetCDC=rl[0].Product_Set_CD__c; res.ApplicableDepartmentC=rl[0].Applicable_Department__c; res.ProductCategoryC=rl[0].Product_category__c; res.ValidDateC=rl[0].Valid_Date__c; res.InvalidDateC=rl[0].Invalid_Date__c; res.QuoteSelectInfoC=rl[0].Quote_Select_Info__c; res.DescriptionC=rl[0].Description__c; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } class InitData{ @AuraEnabled public String name; @AuraEnabled public String ProductSetCDC; @AuraEnabled public String ApplicableDepartmentC; @AuraEnabled public String ProductCategoryC; @AuraEnabled public Date ValidDateC; @AuraEnabled public Date InvalidDateC; @AuraEnabled public String QuoteSelectInfoC; @AuraEnabled public String DescriptionC; } }