You need to sign in to do that
Don't have an account?
Jim Morgando
Apes Test Class
I'm trying to create a Test Apex class but getting a
Error: Compile Error: Expression cannot be assigned at line -1 column -1
@isTest
public class ICNFILL {
Public static void validate() {
BMCServiceDesk__Incident__c.ICN_Circuit_No__c ='02ELP-NW5.2646';
}
}
The trigger that is for this auto filles fields on the Incident ticket in Remedyfoce.
Error: Compile Error: Expression cannot be assigned at line -1 column -1
@isTest
public class ICNFILL {
Public static void validate() {
BMCServiceDesk__Incident__c.ICN_Circuit_No__c ='02ELP-NW5.2646';
}
}
The trigger that is for this auto filles fields on the Incident ticket in Remedyfoce.
Please create an instance of this BMCServiceDesk__Incident__c and then assign the value to instance:
@isTest
public class ICNFILL {
Public static void validate()
{
BMCServiceDesk__Incident__c obj = new BMCServiceDesk__Incident__c();
obj.ICN_Circuit_No__c ='02ELP-NW5.2646';
}
}
ICNFILL.validate(), Details: System.StringException: Invalid id: 02ELP-NW5.2646 Class.ICNFILL.validate: line 4, column 1
@isTest
private class ICNFILL {
static testMethod void validate() {
BMCServiceDesk__Incident__c b = new BMCServiceDesk__Incident__c(ICN_Circuit_No__c ='02ELP-NW5.2646',
BMCServiceDesk__FKClient__c = 'jim.morgando@illinois.gov', BMCServiceDesk__FKCategory__c = 'Hardward');
insert b;
}
}
Is ICN_Circuit_No__c a lookup field? If so, they you cannot directly assign any string to it. You will have to create its parent record first and then assign the Id of that parent record to it.
Please let me know if this makes sense.