You need to sign in to do that
Don't have an account?
tsreenu92
apex class
public class UpdateField {
public static void upd(List<Customer__c> c)
{
for(Customer__c p:c)
{
if(p.MRRMonthly__c!=CustomerInfo__c.MRR__c)
{
p.MRRMonthly__c=CustomerInfo__c.MRR__c;
}
}
}
}
I am getting an error: Error: Compile Error: Illegal assignment from Schema.SObjectField to Decimal at line 8 column 17
I guess data type of MRRMonthly__c and MRR__c are not same. Visit each custom object and verify it from 'Data Type' column
This "CustomerInfo__c.MRR__c;" seems to be the problem, you need to change it to something else, as this is "Schema.SObjectField"
Hi Sreenu,
What is this 'CustomerInfo__c'..? I guess it is a custom object.
How could you use a custom object directly with out instanciating it.
public class UpdateField {
public static void upd(List<Customer__c> c)
{
CustomerInfo__c objCostInfo = new CustomerInfo__c();
for(Customer__c p:c)
{
if(p.MRRMonthly__c!=objCostInfo.MRR__c)
{
p.MRRMonthly__c=objCostInfo.MRR__c;
}
}
}
}