As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
What is the best way to detect if a save operation os a first time save or an update?
N
Neto Leal
started a topic
about 10 years ago
Is it possible using collection hooks?
tks
1 Comment
M
Michael
said
about 10 years ago
There is no clear-cut way to do it, but one possible solution would be to use a pre-save hook to query for the _id value that is passed in the request. If the request action is PUT, and if it is a POST that doesn't include an _id, one can assume that it is a first-time save. If the request is a POST with an included _id, then the only way to determine if it is a first-time save or second-time save is to query the collection for the passed _id.
Neto Leal
tks