I do not know if this possible as my research has turned up nothing. Here is my HTML code.
Here is my RPG code.
If my document creation fails how can I pick up the error message so it displays a proper message to the end user.
Thanks in advance
Code:
var MergeDocument = function(){ PMID = currentRecord.data.PMID; PEID = Ext.getCmp('DOCUMENT').getValue() Ext.DomHelper.append(document.body, { tag: 'iframe', frameBorder: 0, width: 0, height: 0, css: 'display:none;visibility:hidden;height:1px;', src: 'vvcall.pgm?sid=' + sid + '&opt=' + opt + '&pgm=prmergesb&action=mergeDocument&PMID=' + PMID + '&PEID=' + PEID }); Ext.getCmp('mergeWindow').hide(); parent.showMessage('', '<b><center>Your document will be available shortly<\/b><\/center>'); };
Code:
// If document created successfully // Then send the file to the browser // Else send error to the browser If Type = 'S'; vvOut.download='Y'; vvOut.file = %Char(Name) + '.docx'; vvOut.contentType = 'application/x-download'; vvout.binary='Y'; vvOut_file(NewDoc:vvOut); Else; vvOut_toJsonPair('SUCCESS:0,MSG:' + %TrimR(Message)); EndIf;
Thanks in advance
Comment