You need to sign in to do that
Don't have an account?
Poorna Developer
Pass custom field value in to apex class
I have an object called 'Application__c' and field in that called 'Customer_Id__c'.
I need to pass the Customer_Id__c to apex class whenever user enter the data in the object.
Apex class
public static void passvalue() { String getcusid; Loan_Application__c lapp = new Loan_Application__c(); getcusid=lapp.Saltedge_Customer_Id__c; System.debug('customerid from sf' +getcusid); }
Trigger to get Customer_Id__c data whenever user given in the object.
Is there any idea ?
Thanks.
I need to pass the Customer_Id__c to apex class whenever user enter the data in the object.
Apex class
public static void passvalue() { String getcusid; Loan_Application__c lapp = new Loan_Application__c(); getcusid=lapp.Saltedge_Customer_Id__c; System.debug('customerid from sf' +getcusid); }
Trigger to get Customer_Id__c data whenever user given in the object.
Is there any idea ?
Thanks.
Try The Below Code Please Mark It As Best Answer If It Helps
Thank You!
Please Mark It As Best Answer If it Helps So It Can Help Others In Future.And It Motivates us To Give More In Community
Thank You!
Hi Poorna,
you are creating object instance named "lapp" and without inserting it you want to print ID that's why it was showing null there.
so the solution is to insert that object first.
or Maybe your trigger is on before insert so make it as "after insert and before update".
If it will help you please mark it as best answer.
Thank You