You need to sign in to do that
Don't have an account?
Gaurii
I am writing the controller for lightning component which query records on some condition and update the owner field with created by user can some body please help
public class Code123Controller {
public static boolean setValue{get; set;}
@AuraEnabled
public static String getUserList1() {
String usrid = UserInfo.getUserId();
return usrid;
}
@AuraEnabled
public static boolean getCodeDetails(string userid,string Code ) {
Code__c CodeList;
//String usrid = UserInfo.getUserId() ;
try{
CodeList = [SELECT Id,Active__c,Code__c FROM Code__c
where Code__c=:Code AND Active__c = True];
Code__c updateOwner = new Code__c();
if(CodeList.Code__c == Code){
overCodeList.OwnerId = CreatedbyId;
update CodeList;
setValue = true;
}
}Catch(Exception e){
setValue = false;
system.debug(e);
}
return setValue;
}
}
public static boolean setValue{get; set;}
@AuraEnabled
public static String getUserList1() {
String usrid = UserInfo.getUserId();
return usrid;
}
@AuraEnabled
public static boolean getCodeDetails(string userid,string Code ) {
Code__c CodeList;
//String usrid = UserInfo.getUserId() ;
try{
CodeList = [SELECT Id,Active__c,Code__c FROM Code__c
where Code__c=:Code AND Active__c = True];
Code__c updateOwner = new Code__c();
if(CodeList.Code__c == Code){
overCodeList.OwnerId = CreatedbyId;
update CodeList;
setValue = true;
}
}Catch(Exception e){
setValue = false;
system.debug(e);
}
return setValue;
}
}
Footprints on the Moon
Can you share what error is being shown?
Gaurii
there is no error as such but it is not working