purchaserOpeSeniorStaff = new Roles__c();
purchaserOpeSeniorStaff.RoleID__c = 14.0;
purchaserOpeSeniorStaff.Corporation_Type__c =2.0;
purchaserOpeSeniorStaff.RoleName__c = 'Operations Senior Staff';
insert purchaserOpeSeniorStaff;
On Line 1 it is showing error System.QueryException, Where Roles__c() is a Custom Object with three fields --> RoleId,RoleName,IsActive
This is the line where i am getting error --> *usm.getCompanyCFOUser(supplierCompany.Id,CRConstants.COMPANYTYPE_SUPPLIER);*
and this is the method that above line is calling -->
public UserRoles__c getCompanyCFOUser (ID companyID,Double companyType) {
Roles__c role=new Roles__c();
role = getRoleIDForCFO(companyType);
//System.debug('Company Code :' + companyID);
//System.debug('Company Type :' + companyType);
//System.debug('Role :' + role.Id);
UserRoles__c userRoles = new UserRoles__c();
userRoles=[Select u.FK_UserId__r.Email__c, u.FK_UserId__r.FirstName__c,u.FK_UserId__r.LastName__c,
u.FK_UserId__r.Title__c, u.FK_UserId__r.Telephone__c, u.FK_UserId__r.Password__c,
u.FK_UserId__r.IsActive__c, u.FK_UserId__r.id, u.FK_UserId__r.UserID__c
from UserRoles__c u where u.FK_RoleID__c=:role.Id and
u.FK_UserId__r.Fk_CompanyID__c =:companyID and u.IsDeleted__c=false limit 1];
return userRoles;
}
How will i fix it ?