• Sai Kiran 1846
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
public without sharing class X311Portal_EditProfileCtrl {
    @AuraEnabled
    public static Map<String, Object> getContactDetails(){
        
        Map<String, Object> returnMap = new Map<String, Object>();
        
        User userRecord = [SELECT Id, AccountId, ContactId FROM User WHERE Id =: UserInfo.getUserId()];
        
        Account personAccRecord = [SELECT FirstName, LastName, PersonEmail, Phone, PersonMailingCity, PersonMailingState,
                                    PersonMailingPostalCode, PersonMailingStreet FROM Account WHERE Id =: userRecord.AccountId];
        
        returnMap.put('personAccRecord', personAccRecord);
        
        return returnMap; 
    }   

    @AuraEnabled
    public static void updateContactDetails(String record) {
        Account accountRecord = (Account) JSON.deserialize(record, Account.class);
        upsert accountRecord;
    }
}
public without sharing class X311Portal_EditProfileCtrl {
    @AuraEnabled
    public static Map<String, Object> getContactDetails(){
        
        Map<String, Object> returnMap = new Map<String, Object>();
        
        User userRecord = [SELECT Id, AccountId, ContactId FROM User WHERE Id =: UserInfo.getUserId()];
        
        Account personAccRecord = [SELECT FirstName, LastName, PersonEmail, Phone, PersonMailingCity, PersonMailingState,
                                    PersonMailingPostalCode, PersonMailingStreet FROM Account WHERE Id =: userRecord.AccountId];
        
        returnMap.put('personAccRecord', personAccRecord);
        
        return returnMap; 
    }   

    @AuraEnabled
    public static void updateContactDetails(String record) {
        Account accountRecord = (Account) JSON.deserialize(record, Account.class);
        upsert accountRecord;
    }
}