You need to sign in to do that
Don't have an account?
Trigger to create a new record on the custom object when the status field of the Product object ischanged
Hi folks,
I wanna create a new record in my maintenance custom object automatically when the status field of the standard Product object is changed to 'Out of maintenance'. So could any one please help me in writing trigger for the same.
I wanna create a new record in my maintenance custom object automatically when the status field of the standard Product object is changed to 'Out of maintenance'. So could any one please help me in writing trigger for the same.
Carefull, doing that you will have a new Maintenance__c record if Product status is 'Out of maintenance'.
If you want to have only one record where Product status change from any value to 'Out of maintenance', you have to get old Product status and continue only if it's different of 'Out of maintenance'.
Fred
If a user changes a product's status to Out for Maintenance, a new Maintenance History record should be created that is a child of the product. The from date should be today's date, the to date should be left blank.
When a user changes a product's status from Out for Maintenance to something else, Salesforce should find the most recent Maintenance History record for that product that has no "to" date, and set the to date to the current date.
Could anyone get me the right code for this requirement.
Using trigger this is not possible.