OnSave event should check for validations because onSaveValid comes after that.Can you share your custome code that you are caliing onSave to autoname the DCR?
IWEventRegistry.addFormHandler("onSave", handleOnSaveValid);........function handleOnSaveValid(){ // automatically get a dcr name if it doesn't have one already if ((IWDCRInfo.getDCRName() == null) || (IWDCRInfo.getDCRName() == '')) { //IWDatacapture.setHighlightMode(true); retrieveDCRName(); return false; } else { //save_callback(); return true; } }
so where exactly are your validations? Are there any additional validation on items that you are doing from formAPI?
You'll have to use onSaveValid. The flow will be something like below.Call your autonaming function onSaveValid. Function will assign a name to the DCR and then do a IWDatacapture.save().
Tried it already. This is what happens in this case:1. User canot save DCR without passing the validations(as expected).2. When the user clicks on Finish or Save and the form is validated, I get the Save Form As dialog and in the background the DCR is being saved with the custom name(which I wanted).The only concern which I have while using onSaveValid is now suppressing the Save Form As dialog so that it never shows up. Do you know of any way to do that?
Within templating.cfg you can remove SaveAs (or any other action button) through "actionlist" attribute of the "viewoptions" Tag, take a look at FormsPublisher Developer’s Guide
Hi Boris,The issue here is not to remove the SaveAs button from DCT but to suppress the Save Form As dialog when I am using custom autonaming. Is there any OOTB or custom way this can achieved?