You need to sign in to do that
Don't have an account?
how to add a text content +value in trigger
Hi,
I have a trigger which copies all the values of fields from one object to another,
I want to add some text value to specific field followed by the value
Trigger Leadprocess on Lead_Object__c(after insert,after update)
{
List<Lead> sub=new List<Lead>();
for(Lead_Object__c v : Trigger.new)
{
Lead s = new Lead();
// s.RecordType.name =v.Record_Type__c;
s.FirstName=v.First_Name__c;
s.LastName =v.Last_Name__c;
s.Account_Type__c = v.Account_Type__c;
s.Units_In_Inventory__c = v.Units_In_Inventory__c;
s.Company = v.company__c;
s.PostalCode = v.Billing_Zip__c;
s.AnnualRevenue =v.Annual__c;
s.Salutation = v.Salutation__c;
s.LeadSource =v.Record_Type__c;
s.Status =v.Leadstatus__c;
s.Additional_Information__c =v.ZID__c;
sub.add(s);
insert sub;
}
}
Something like this,
s.Additional_Information__c ="The entered value is "+ v.ZID__c;
Please help me to know how to do this
Thanks in Advance
What you've done there is correct, except you have put in double quotes, you need to use single quotes for text expressions in SFDC
if the value is not of type string, cast it to a string using string.valueof(YOURFIELDHERE);
Hope this helps
Vish
All Answers
What you've done there is correct, except you have put in double quotes, you need to use single quotes for text expressions in SFDC
if the value is not of type string, cast it to a string using string.valueof(YOURFIELDHERE);
Hope this helps
Vish
Vish