You need to sign in to do that
Don't have an account?
sfdc dev 2264
Long text area field in trigger help needed
Hi,
I am having a long text area field where i am not getting the values in my trigger , Let me know how to refer long text area field in my trigger
MY TRIGGER :
trigger createcontract on Proposal__c(after insert) {
List <Contract__c > contractToInsert = new List <Contract__c> ();
for (Proposal__c o : Trigger.new) {
Id recId = Schema.SObjectType.Proposal__c.getRecordTypeInfosByName().get('Adhoc Charter').getRecordTypeId();
if (o.RecordTypeId == recId) {
Contract__c v = new Contract__c ();
v.Account__c = o.Account__c;
v.Opportunity__c = o.Opportunity__c ;
v.Name=o.Name;
v.Proposal__c =o.Id;
v.Contract_Start_Date__c=o.Proposal_Start_Date__c;
v.Contract_End_Date__c =o.Proposal_End_Date__c;
v.Forecast_Charter_Spend__c =o.Forecast_Charter_Spend__c;
v.Description__c=o.Description__c;
v.Contact_Information__c=o.Contact_Information__c;
v.Forecast_Charter_Spend__c =o.Forecast_Charter_Spend__c;
v.RecordTypeId = [select Id from RecordType where Name = 'Adhoc Charter' and SobjectType = 'Contract__c'].Id;
contractToInsert.add(v);
}
}
try {
insert contractToInsert;
} catch (system.Dmlexception e) {
system.debug (e);
}
}
Kindly help me pls
Thanks in advance
I am having a long text area field where i am not getting the values in my trigger , Let me know how to refer long text area field in my trigger
MY TRIGGER :
trigger createcontract on Proposal__c(after insert) {
List <Contract__c > contractToInsert = new List <Contract__c> ();
for (Proposal__c o : Trigger.new) {
Id recId = Schema.SObjectType.Proposal__c.getRecordTypeInfosByName().get('Adhoc Charter').getRecordTypeId();
if (o.RecordTypeId == recId) {
Contract__c v = new Contract__c ();
v.Account__c = o.Account__c;
v.Opportunity__c = o.Opportunity__c ;
v.Name=o.Name;
v.Proposal__c =o.Id;
v.Contract_Start_Date__c=o.Proposal_Start_Date__c;
v.Contract_End_Date__c =o.Proposal_End_Date__c;
v.Forecast_Charter_Spend__c =o.Forecast_Charter_Spend__c;
v.Description__c=o.Description__c;
v.Contact_Information__c=o.Contact_Information__c;
v.Forecast_Charter_Spend__c =o.Forecast_Charter_Spend__c;
v.RecordTypeId = [select Id from RecordType where Name = 'Adhoc Charter' and SobjectType = 'Contract__c'].Id;
contractToInsert.add(v);
}
}
try {
insert contractToInsert;
} catch (system.Dmlexception e) {
system.debug (e);
}
}
Kindly help me pls
Thanks in advance
able to get the values, please see the sample code
Thanks