You need to sign in to do that
Don't have an account?
Raffus
How to write a test method for this
@AuraEnabled public static void saveCustomerInfo(String data, String partyId, String mobile) { rand_App_Customer__c customer = (rand_App_Customer__c) JSON.deserialize(data, rand_App_Customer__c.class); customer.Party_Id__c = String.isBlank(partyId) ? mobile : partyId; customer.Customer_ID__c = customer.Party_Id__c; customer.Customer_Mobile__c = mobile; if (String.isNotBlank(mobile)) { customer.Id = [SELECT Id FROM rand_App_Customer__c WHERE Customer_Mobile__c = :mobile LIMIT 1]?.Id; } customer.recalculateFormulas(); customer.Name = String.isBlank(customer.Customer_Name__c) ? 'User' : customer.Customer_Name__c; upsert customer Customer_ID__c; }