You need to sign in to do that
Don't have an account?
amyh
My First Trigger attempt and its error message
Hello,
I'm trying to create my first trigger, but I get the error message:
Save error: Comparison arguments must be compatible types: Schema.SObjectField, Boolean
What I'm trying to accomplish is to automatically generate a case when a user checks a box
on the Sales Order Line Item page.
Below is my attempt, and the error is on line 5.
I would greatly appreciate any help or direction.
thanks!!
trigger CreateCaseAfterShippingConfirmsOrder on SFDC_520_QuoteLine__c
(after update)
{
if (SFDC_520_QuoteLine__c.Shipping_Confirms_Order__c == True)
{
Case newCase = new Case(
Subject = 'New Data Production Project',
Status = 'Not Started',
Product__c = 'XXX One (2.0)',
Priority = 'Sev-4 (when resources allow)',
Origin = 'Web'
);
insert newCase;
}
else
{
}
}
I'm trying to create my first trigger, but I get the error message:
Save error: Comparison arguments must be compatible types: Schema.SObjectField, Boolean
What I'm trying to accomplish is to automatically generate a case when a user checks a box
on the Sales Order Line Item page.
Below is my attempt, and the error is on line 5.
I would greatly appreciate any help or direction.
thanks!!
trigger CreateCaseAfterShippingConfirmsOrder on SFDC_520_QuoteLine__c
(after update)
{
if (SFDC_520_QuoteLine__c.Shipping_Confirms_Order__c == True)
{
Case newCase = new Case(
Subject = 'New Data Production Project',
Status = 'Not Started',
Product__c = 'XXX One (2.0)',
Priority = 'Sev-4 (when resources allow)',
Origin = 'Web'
);
insert newCase;
}
else
{
}
}
That should work.
Thank you very much for your time.
Can I ask you how I go about creating the test class (assuming that's what I need
to do, since I can't seem to deploy my new trigger), and how do I actually run the test.
I've been round and round, but no luck.
Thank you very much!
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
jk