You need to sign in to do that
Don't have an account?
Garrett Miller
Can I write a trigger that adds a Fee Opportunity whenever an account's renewal date passes?
Whenever an account's renewal date passes, someone has to manually enter an opportunity for an annual fee. I want to create a trigger/workflow rule/proccess that automates this, but I am unsure what the best way would be. There is no risk of the opportunity not being "Won" as it is just a fee.
Does anyone have a suggestion on how to write a trigger for this? Or, is ther a better way than writing a trigger?
Best,
Garrett
Note : Please click on the images to view them larger.
All Answers
@Shruti S It would be a case of:
If today's date is greater than Today(), then the Next_Renewal_Date__c has passed
If today's date is less than today, then the Next_Renewal_Date__c has not passed.
Every time Next_Renewal_Date__c passes, it gets updated to the next year.
For example, say Account - Garrett has a Next_Renewal_Date__c of 6/8/2017. When the Today() date becomes 6/9/2017, then my Next_Renewal_Date__c has passed and my Next_Renewal_Date__c becomes 6/8/2018.
So basically, I would want a trigger that says.
Note : Please click on the images to view them larger.
Yeah don't worry, I will mark it Best Answer as soon as I finish implementing it. Do you have any idea if this will bypass required fields on my Opportunity object? In addition, do you know if this will make me the Owner of the Opportunity?
No, it will not bypass.
Do you know if this will make me the Owner of the Opportunity?
Yes, it will make you the owner.
So I am having some issues implementing this. I have changed it to an immediate action in order to iron out the issues but I have a question about setting the fields for Creating a Record. I got an error, This error occurred when the flow tried to create records: MALFORMED_ID: Company Name: id value of incorrect type: "Pseudo Company Name Here"
This is in relation to the field circled in the picture below. My question is, do I set the Company_Name__c to the Salesforce ID from the Company that the Opportunity is tied to? When I first select Company Name as the field to add, it automatically assumes the Type is ID.
Nevermind I figured it out. With the field Company Name I set:
Type = Reference
Value = [Account].Id
@Shruti S
I have a question about this if you have the time. Will this only create a new record if I make edits/changes to a record? Or will it happen atuomatically? I don't want to have to make any changes to a record in order for a new record to be created.
I tried to create a pseudo time field, and set the time dependent action to 1 hour after the pseudo time field, but no new record was created.