You need to sign in to do that
Don't have an account?
Btuitasi1
Idea Zone API Name
Hey guys,
I am writing a trigger to create a new record in Idea from an existing record in one of our custom objects. Here is my code:
trigger backToIdea on Idea_Lobby__c (after update) {
for (Idea_Lobby__c yourIdea : Trigger.new) {
if (yourIdea.Approval__c == 'Approved')
{
Idea backAgain = new Idea();
backAgain.Name__c = yourIdea.Name__c;
backAgain.Location__c = yourIdea.Location__c;
backAgain.Company__c = yourIdea.Company__c;
backAgain.Title = yourIdea.Name;
backAgain.Body = yourIdea.Idea_Body__c;
insert backAgain;
}
else if(yourIdea.Approval__c == 'Delete')
{
Idea_Lobby__c y = new Idea_Lobby__c();
y.Id = yourIdea.Id;
delete y;
}
}
}
Since Zone is a required field, I get an error when the trigger fires. Does anyone know the API name for Zone in the Idea object, so I can set it when the new record is created?
Thanks!
I am writing a trigger to create a new record in Idea from an existing record in one of our custom objects. Here is my code:
trigger backToIdea on Idea_Lobby__c (after update) {
for (Idea_Lobby__c yourIdea : Trigger.new) {
if (yourIdea.Approval__c == 'Approved')
{
Idea backAgain = new Idea();
backAgain.Name__c = yourIdea.Name__c;
backAgain.Location__c = yourIdea.Location__c;
backAgain.Company__c = yourIdea.Company__c;
backAgain.Title = yourIdea.Name;
backAgain.Body = yourIdea.Idea_Body__c;
insert backAgain;
}
else if(yourIdea.Approval__c == 'Delete')
{
Idea_Lobby__c y = new Idea_Lobby__c();
y.Id = yourIdea.Id;
delete y;
}
}
}
Since Zone is a required field, I get an error when the trigger fires. Does anyone know the API name for Zone in the Idea object, so I can set it when the new record is created?
Thanks!
https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_community.htm
http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_community.htm
All Answers
https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_community.htm
http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_community.htm