Untitled

 avatar
unknown
plain_text
2 years ago
693 B
4
Indexable
@AuraEnabled
public static List<ContactPointAddress> getContactPointAddress(Map<String, Object> dataMap) 
{
String userId = UserInfo.getUserId();
User userObj = [SELECT ContactId, AccountId FROM User WHERE Id = :userId LIMIT 1]
; 
return [ SELECT Id, Name, AddressType, Country, Address, City, State,Street, PostalCode, IsDefault FROM ContactPointAddress WHERE ParentId = :userObj.AccountId];}
@AuraEnabled
public static ContactPointAddress getContactPointAddressById(Map<String, Object> dataMap) 
{ String cpID = (String)dataMap.get('cpAddressId');
return [SELECT Id, Name, AddressType, Country, Address, City, State,Street, PostalCode, IsDefault FROM ContactPointAddress WHERE Id = :cpID ];}
Editor is loading...