You need to sign in to do that
Don't have an account?
Zach Ackerman
Expression cannot be assigned at line -1 column -1
Essentially if the product name is UH I want the plan package name to be set using Ultimate Health a space and the field armada plan package name.
trigger PlanPackageNames on Plan__c (Before Insert) {
for (Plan__c Plan__c : Trigger.new)
{
IF(Plan__c.Product_Name__c=='UH')
{
Plan__c.Name='Ultimate Health'+' '+Plan__c.Armada_Plan_Package_Name__c;
}
}
}
trigger PlanPackageNames on Plan__c (Before Insert) {
for (Plan__c Plan__c : Trigger.new)
{
IF(Plan__c.Product_Name__c=='UH')
{
Plan__c.Name='Ultimate Health'+' '+Plan__c.Armada_Plan_Package_Name__c;
}
}
}
trigger PlanPackageNames on Plan__c (Before Insert) {
for (Plan__c plan: Trigger.new)
{
IF(plan.Product_Name__c=='UH')
{
plan.Name='Ultimate Health'+' '+plan.Armada_Plan_Package_Name__c;
}
}
}
But if you are trying to create the record from Salesforce UI (Means page layout) then you need to enter the value on page layout And After that your trigger logic will work and will update the Name field value.
NOTE:- When ever you want to update same record then you should use the Before Trigger.
If a field is required on the api level (you have set value is required in the field on the custom field) you should enter some value to save it. If its on page layout level, you should not be able to save it while creating a record manually.I would prefer setting the custom field required on page layout level for your requirement