You need to sign in to do that
Don't have an account?
Andreea T
I need to remove one field from apex class
Hi there,
I need to remove one lookup field from the Account (lookup to User) called CSM__c, but it's referencing an apex class, please suggest how can I remove this field.
Here is my apex class
Thanks
I need to remove one lookup field from the Account (lookup to User) called CSM__c, but it's referencing an apex class, please suggest how can I remove this field.
Here is my apex class
public class CommissionBuilder { static final set<String> invalidOwnerIds = new Set<String> {'005b0000001Noq0','005b0000000M5sd','005b0000003AC0f'}; static final Integer StartReferenceYear = 2017; static final Integer StartYearTeamLeadersBonus = 2018; Map<String,User> MapUsersbyName; Map<id,User> MapUsers; Map<id,Contract> mapContracts; Invoice__c Invoice = new Invoice__c (); Commission_Model__c CommissionModel; List<Contributer__c> Contributers = new List <Contributer__c> (); public CommissionBuilder setMapContracts(Map<id,Contract> mapContracts){ this.mapContracts = mapContracts; return this; } public CommissionBuilder setMapUsersID(Map<id,User> MapUsersID){ this.MapUsers = MapUsersId; return this; } public CommissionBuilder setMapUserbyName(Map<String,User> MapUsersbyName){ this.MapUsersbyName = MapUsersbyName; return this; } public CommissionBuilder setInvoice(Invoice__c Invoice){ this.Invoice = Invoice; return this; } public CommissionBuilder setContributer(List<Contributer__c> Contributers){ this.Contributers = Contributers; return this; } public CommissionBuilder setCommissionModel(Commission_Model__c CommissionModel){ this.CommissionModel = CommissionModel; return this; } public Commission__c Rebuild(Commission__c C){ C.Commission_Model__c = CommissionModel.id; C.BO__c = Invoice.Normalized_Amount__c * (CommissionModel.BO__c/100); C.MO__c = Invoice.Normalized_Amount__c * CommissionModel.MO__c/100; C.Marketing__c = CalCommissionModelarketingCommission(); C.FX_Strategy__c = CalcFXStrategyCommission(); C.CSM__c = CalcCSMCommission(); C.Team_Leader__c = CalcTeamLeaderCommission(); if(!C.Don_t_Recalculate__c) CalcSalesCommission(C); return C; } public Commission__c build(){ Commission__c C = new Commission__c(Commission_Model__c = CommissionModel.id, BO__c = Invoice.Normalized_Amount__c * (CommissionModel.BO__c/100), Invoice__c = Invoice.id, MO__c = Invoice.Normalized_Amount__c * CommissionModel.MO__c/100, Marketing__c = CalCommissionModelarketingCommission(), Team_Leader__c = CalcTeamLeaderCommission(), FX_Strategy__c = CalcFXStrategyCommission(), CSM__c = CalcCSMCommission()); CalcSalesCommission(C); return C; } ... }Please help me how can I remove this field.
Thanks
You could use code without the requested field in the same class like below:
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.