You need to sign in to do that
Don't have an account?

how to fetch custom object field in apex class
HI all, i have scenario like,1 custom object and 2 custom fields i.e. username_c and password__c so i am storing the password in custom object. so what i want is ,whatever storing the password in custom object that wants to be return by using apex class.i was tring to return but i am not getting so pls relsove this issue.but i am not using any vf page. public with sharing class Sample { public static string registerUser() { List obj = new List(); obj = [Select Username__c,Password__c from Login__c where Username__c =:id Limit 1]; return password__c; } THnaks
do you want to send the username and password to the class once you have saved.
If it is your requirement, then
-> Write a trigger either in before insert or after insert event.
-> call a class with in the trigger and pass the values to the class from the trigger.
If it is not your requirement, please let me know the correct requirement.
All Answers
do you want to send the username and password to the class once you have saved.
If it is your requirement, then
-> Write a trigger either in before insert or after insert event.
-> call a class with in the trigger and pass the values to the class from the trigger.
If it is not your requirement, please let me know the correct requirement.