You need to sign in to do that
Don't have an account?
Uves Ravat
For every invoice have just one credit note
Hi,
I want to create trigger or class that will only allow the user to create credit note per invoice and also make sure for every invoice there is matching credit note.
Any help???
Cheers
This is basically the pseudocode that should give you what you need.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_trigger.htm
This should show how to create a basic trigger.
Good luck!
All Answers
You could have a trigger, that on creation of a CreditNote runs a query to see if there already exists another credit note on the invoice. If there is another one, you force your trigger to fail out with an error.
would be able to give an example because am new to force.com and apex
This is basically the pseudocode that should give you what you need.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_trigger.htm
This should show how to create a basic trigger.
Good luck!