Allowing a Record to be saved as "DRAFT"

A place for users and developers of the Xataface to discuss and receive support.

Allowing a Record to be saved as "DRAFT"

Postby rleyba » Wed Sep 12, 2012 10:42 pm

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.
rleyba
 
Posts: 53
Joined: Sat Dec 04, 2010 3:50 pm

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

Postby shannah » Thu Sep 13, 2012 9:58 am

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.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 17 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved