• gaganSFDC
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
Hi, i want to merge these methods and create one generic method, so that i will have to pass the type of object only as both the object having same fields.

//update Lead
private static void updateLead(Map<String,String> dataMap){      
        Lead obj = new lead();
        obj.Id= dataMap.get('Id');            
        obj.Current_Assets_Type_of_Charge__c = 'abcd';
        obj.Single_state_Remarks__c = 'xyz';
        obj.More_than_3_months__c =  'pqr';
        obj.More_than_3_months_Remarks__c ='asdf';
        update obj;
    }

//update opportunity
private static void updateOpportunity(Map<String,String> dataMap){     
        Opportunity obj = new Opportunity();
        obj.Id= dataMap.get('Id');            
        obj.Current_Assets_Type_of_Charge__c = 'abcd';
        obj.Single_state_Remarks__c = 'xyz';
        obj.More_than_3_months__c =  'pqr';
        obj.More_than_3_months_Remarks__c ='asdf';
        update obj;
    }
 
Hi All,
In lighting conponent's controller i have this code and i have a problem here that if i remove the if- condition then the callback return success and working fine but if not remove the if-condition then return error. All the consoles are also printing.
what am i doing wrong here ?

var validd = helper.validate(component,event);
        console.log('validd= '+validd);    // return true and all consoles are called
        if(validd){
            console.log('inside validd - if');
            var action = component.get("c.saveRecord");

             console.log('newCustBillObj='+newCustBillObj);
             console.log('newCustSoObj='+newCustSoObj);
            
            action.setParams({ "objCustBill" : newCustBillObj,   "objCustBillSO" : newCustSoObj   });
            action.setCallback(this, function(response){
                var state= response.getState();
                var result = response.getReturnValue();
                if(state === "SUCCESS"){                                    
                    alert('save-Record= '+result);
                }
                if(state === 'ERROR'){
                    alert('error in saving Record= '+result);
                }
            });
            
              
 console.log('before - enqueueAction');
            $A.enqueueAction(action); 
                
console.log('after - enqueueAction');
        }

<h1> pls help </h1>
hi
 this the first time i am using ANT, dont know how to use it plz tell me step by step if possible
 query = 'Select ' + CorrespondingFields + ' from ' + AllObjectsList;

Here,  object and fields of that object both are dynamic.
pls help how to display records in table on visualforce page.
Hello,
i am not able to display duplicate record on vf page.
plz help
hello,
i have a situation that i want to use previous record's picklist status in new record
Hi, i want to merge these methods and create one generic method, so that i will have to pass the type of object only as both the object having same fields.

//update Lead
private static void updateLead(Map<String,String> dataMap){      
        Lead obj = new lead();
        obj.Id= dataMap.get('Id');            
        obj.Current_Assets_Type_of_Charge__c = 'abcd';
        obj.Single_state_Remarks__c = 'xyz';
        obj.More_than_3_months__c =  'pqr';
        obj.More_than_3_months_Remarks__c ='asdf';
        update obj;
    }

//update opportunity
private static void updateOpportunity(Map<String,String> dataMap){     
        Opportunity obj = new Opportunity();
        obj.Id= dataMap.get('Id');            
        obj.Current_Assets_Type_of_Charge__c = 'abcd';
        obj.Single_state_Remarks__c = 'xyz';
        obj.More_than_3_months__c =  'pqr';
        obj.More_than_3_months_Remarks__c ='asdf';
        update obj;
    }
 
 query = 'Select ' + CorrespondingFields + ' from ' + AllObjectsList;

Here,  object and fields of that object both are dynamic.
pls help how to display records in table on visualforce page.
Hello,
i am not able to display duplicate record on vf page.
plz help
hello,
i have a situation that i want to use previous record's picklist status in new record