You need to sign in to do that
Don't have an account?
Salesforce Admin 110
code error
problem with code
i need to refactor this code:
error = Initial term of field expression must be a concrete SObject: List<pba__Listing__c> line 31
i need to refactor this code:
error = Initial term of field expression must be a concrete SObject: List<pba__Listing__c> line 31
public without sharing class copylistingpricetproperty { public static void resisales(List<pba__Property__c> propertyIds){ Id recId = Schema.SObjectType.pba__Property__c.getRecordTypeInfosByName().get('Residential Sales').getRecordTypeId(); /* list<pba__Property__c> properties = [select id, name, published__C from pba__Property__c where id in :propertyIds and published__c = true]; set<id> propertiesset = new set<id>(); for(pba__Property__c prop : properties) propertiesset.add(prop.Id); */ list<pba__Listing__c> listings = [select id, pba__ListingPrice_pb__c,pba__Status__c,pba__Property__c, recordtypeid, name from pba__Listing__c where /* id in :propertiesset and */ recordtypeid = :recId and pba__Status__c = 'Approved']; set<id>listset = new set<id>(); for(pba__Listing__c lists : listings) listset.add(lists.pba__Property__c); List<pba__Property__c> propstoUpdate = new List<pba__Property__c>(); for(pba__Property__c propp : propertyIds) if( listset.contains(propp.id)) listings.pba__ListingPrice_pb__c = propp.Asking_price__c; update propsToUpdate; } }
Please do let me know if it works, I implemented it based on my understanding.
Also if possible paste your full requirement if it doesn't work.
Please do let me know if it helps you.
Regards,
Mahesh