Hi,I need to do give different behaviour for the 'Finish' and the 'Save' buttons in the DCR. The validation rules for each case should be different. I tried using the saveHandler function in the javascript. Please find attached the file. I get the correct alert when I click the 'Save' button and the 'SaveAs' button. But all other buttons in the DCR (Finish,preview,generate) passes the Id of the 'Save' event ie 1 to the savehandler. So always the save block is executed. SaveAs passes the Id 2 to the savehandler. I somehow need to know whether the save is triggered due to 'Save' button or 'Finish' button and give separate set of validations for each.Please help!
onClose
//different button values for formspubdatacapture.SaveBtn = 1;datacapture.SaveAsBtn = 2;datacapture.SaveAndCloseBtn = 3;datacapture.PreviewBtn = 4;datacapture.GenerateBtn = 5;
IWDatacapture.SAVE_BUTTON = _iwdatacapture.SaveBtn;IWDatacapture.SAVEAS_BUTTON = _iwdatacapture.SaveAsBtn;IWDatacapture.SAVECLOSE_BUTTON = _iwdatacapture.SaveAndCloseBtn;IWDatacapture.PREVIEW_BUTTON = _iwdatacapture.PreviewBtn;IWDatacapture.GENERATE_BUTTON = _iwdatacapture.GenerateBtn;
Hey that's exactly what I'd been trying in the script attached with my post....But the problem is that it does not recognise the 'Finish', but takes it as just a 'save'. Following are the integers denoting the clicked button that are passed to the saveHandler function when I run the script.'Save' passes '1''Save As' passes '2''Finish' passes '1' itself.Out of curiosity I tried the 'preview' and 'generate' buttons also, they too passes a value of 1 to the function.Since both Finish and Save returns 1, the save block in the switch runs and displays 'It is save'.Have any of you tried this saveHandler buttons. Is there anything else I need to do other than this Script.I'm attaching the script once more for your reference.Any help is highlyyyyy appreciated.Thanks in advance.
Save and SaveAs was working fine already. Save returns 1 and SaveAs returns 2...
If this is the case it should work right :-(.
Are there any other configurations/files I need to verify/modify to get this working.