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
Nobu.SNobu.S 

recently class properties can not be available in LWC component

Before (at least in May), I could view properties returned from Apex Class in LWC component properly. However, this week, I found that I can't view properties of those with the same code. (no change both in LWC and ApexClass).
Does someone have any idea what is the cause and how to waive this issue.
Here attached the fraiming of the code and the result of debug log.
 
******apex class*********

@AuraEnabled
public static List<sample> returnSamples(Id oppId){
 List<sample> samles = new List<sample>();
 ...........

 system.debug(samples);  'I could view proper result
 return samples;

}


public class sample{
 @AuraEnabled
 OpportunityLineItem line01{get;set;}
 @AuraEnabled
 OpportunityLineItem line02{get;set;}
 @AuraEnabled
 OpportunityLineItem line03{get;set;}

}

****LWC.js****

import getSamples from '@salesforce/apex/***.returnSamles'

....

getSamples(oppId: this.recordId)
	.then(result =>{			
		if(result){
			console.log('result-->' + JSON.stringfy(result));
'log: result-->[{},{},{},{}]
			console.log('size-->' + result.length);
'log: size-->4
			.....
		}
	});

 
Best Answer chosen by Nobu.S
SwethaSwetha (Salesforce Developers) 
Salesforce Release upgrades are automatic. They happen on specific dates which are published up to a year in advance on the Salesforce Trust website.

The first set of upgrades happens on sandbox instances 4-6 weeks before a release goes into production. These releases happen three times a year (Winter, Spring, Summer) that include many new features.

API Version of the classes are to be changed manually as don't automatically get updated with releases.

Related: https://www.salesforceben.com/salesforce-summer-21-release-date-preview-information/

If this information helps, please mark the answer as best. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
Hi Nobu,
Since you are referring that the code was working fine during May, it appears to be an issue with the Summer'21 release that happened recently. You can check the code in Summer'21 and Spring'21 orgs to confirm the same

If this information helps, please mark the answer as best. Thank you
Nobu.SNobu.S
Thank you Swetha,
However, I've checked that API version (of Apex and Lightning Component) hasn't changed - it's still 46.0. Does organization itself has such version like "Summer 21"?
SwethaSwetha (Salesforce Developers) 
Salesforce Release upgrades are automatic. They happen on specific dates which are published up to a year in advance on the Salesforce Trust website.

The first set of upgrades happens on sandbox instances 4-6 weeks before a release goes into production. These releases happen three times a year (Winter, Spring, Summer) that include many new features.

API Version of the classes are to be changed manually as don't automatically get updated with releases.

Related: https://www.salesforceben.com/salesforce-summer-21-release-date-preview-information/

If this information helps, please mark the answer as best. Thank you
This was selected as the best answer
Nobu.SNobu.S
Dear Swetha,

Your're correct. When I changed API version, the system showed that I need declaration of global or public not only for method but also for properties.
I modified ApexClass like below and changed the API version, then it work well again. Thank you !

@AuraEnabled
public OpportunityLineItem ***