Hello, I have an issue printing the last version o...
# suitescript
i
Hello, I have an issue printing the last version of a record. I have a button that prints an estimate, but for some reason, it is not showing the last version. I create the PDF and save it to the file cabinet and then using sendRedirect I show it to the user. bt for example if I edit the transaction, save it and print it, the new value edited is not showing on the pdf that opened on a new tab, but the change is on the PDF that was stored on the file cabinet There is a CS that calls this SL ->
Copy code
let id = context.request.parameters.id;

                let _rcd = record.load({
                    type: 'estimate',
                    id: id,
                    isDynamic: true,
                });
                let form = _rcd.getValue('customform');
                let transactionFile = render.transaction({
                    entityId: Number(id),
                    printMode: render.PrintMode.PDF,
                    formId: Number(form)
                });

                transactionFile.folder = runtime.getCurrentScript().getParameter({ name: 'custscript_folder_pdf' });
                transactionFile.name = _rcd.getValue('tranid') + "_" + _rcd.getValue('title');

                let idFile = transactionFile.save();
                context.response.sendRedirect({
                    type: http.RedirectType.MEDIA_ITEM,
                    identifier: idFile
                });
This is the code, when logging the idFile and going to that particular id, the updated value is shown on the PDF but not the file that the button opens, but if I refresh that tab that opens with the PDF it updates the value to the new one. Any idea what Im doing wrong?
b