You need to sign in to do that
Don't have an account?
contract activated signed how to tell if just got activated?
i am trying to detect if the contract just got switched to status: activated signed, and only run this code on the first activation... at present i had a checkbox that i thought would work by triggering true when this code is run but at present appears to be failing... in fact according to eclipse/force explorer there is no such field even though the custom field shows up on the salesforce field under contracts
presently running on contract (before update)
String rType; //declare string rType. //Use a for loop to run through The trigger Contracts and assign for every Case.AccountId a unique Contract.Id from the map List<Case> Cases = new List<Case>(); for (Contract contract:Trigger.new){ if(contract.First_Activation__c == False) { //this is the first time the contract has been activated if (contract.Status == 'Activated Signed') { if(contract.Major_Product_Line__c == 'Background (BSG)' || contract.Major_Product_Line__c == 'Advanced Biometric/I-9 (ABG)' || contract.Major_Product_Line__c == 'Drug (Occupational Health) (OHG)') { if(maprtID_rtName.containsKey(contract.RecordTypeId)) //these are mapping the current contracts reference to recordtype ID to record type name rType = maprtID_rtName.get(contract.RecordTypeId); //rtype is now the recordtypeID of the contract if(rType == 'Application' || rType == 'Supporting Documentation' || rType == 'MSA - Master Service Agreement' || rType == 'Amendment' || rType == 'Standalone Agreement' || rType == 'Addendum') { Case CaseAdd = new Case ();
my code at present, i cant even pull the field via SOQL:
SELECT First_Activation__c FROM Contract where ContractNumber='2012012680'
it errors:
INVALID_FIELD:
SELECT First_Activation__c FROM Contract
^
ERROR at Row:1:Column:8
No such column 'First_Activation__c' on entity 'Contract'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
and yet:
Custom Field Definition Detail |
Field Label | First Activation | Object Name | Contract |
Field Name | First_Activation | Data Type | Checkbox |
API Name | First_Activation__c | ||
Description | used to detect if this is the first time the contract is activated for a trigger. it's to simulate a workflow rule: When a record is created, or when a record is edited and did not previously meet the rule criteria | ||
Help Text | used to detect if this is the first time the contract is activated for a trigger. it's to simulate a workflow rule: When a record is created, or when a record is edited and did not previously meet the rule criteria | ||
Created By | Glen Bradford, 8/29/2011 10:24 AM | Modified By | Glen Bradford, 1/10/2012 2:33 PM |
Default Value | Unchecked |