Page 1 of 1

Allowing a Record to be saved as "DRAFT"

PostPosted: Wed Sep 12, 2012 10:42 pm
by rleyba
Hi Steve,

We have a requirement in my existing Xataface system to allow a record to be saved as DRAFT. In our situation, we have a Change Management application, and in our case, a CHANGERECNUM field is used as the unique identifier for the form being filled up. However, in many instances, our members want to start populating the form, and in case where the CHANGERECNUM info is not yet supplied by the customer, our members can click another button at the bottom of the form called...say..."SAVEASDRAFT", which will be just beside the normal "SAVE" button. This will then cause the record to have the value "DRAFT" + username + date-time saved in the CHANGERECNUM field so that users can edit the record as often as they want until such time that our customer give our members the CHANGECNUM info and then we can just re-save the document with this field info. Could you kindly guide us on an easy way to accomplish this?

Thanks and regards.

Re: Allowing a Record to be saved as "DRAFT"

PostPosted: Thu Sep 13, 2012 9:58 am
by shannah
The easiest way would be to not add a second button, but just use the beforeSave() trigger to populate that field with your special draft value if it is left empty.

If you need to have a second draft button, then you would need to add it via Javascript. You could use jQuery to find the current Save button, then add a button beside it with a javascript handler that will prepopulate the field you want to set.

Like I said, the easiest way would be with the beforeSave() trigger though.