barinvon
07/13/2022, 3:41 PMvar sendUser = url.resolveRecord({
recordType: 'creditmemo',
recordId: cmId,
isEditMode: true
});
window.location = sendUser;
works great, the problem is when the user saves the new Credit Memo they are redirected back to the one that they pressed the copy button on, any idea how I can prevent that redirect?alien4u
07/13/2022, 3:54 PMwindow.location.href
barinvon
07/13/2022, 4:01 PMalien4u
07/13/2022, 4:10 PMbarinvon
07/13/2022, 4:32 PMcreece
07/13/2022, 4:35 PMbarinvon
07/13/2022, 4:38 PMbarinvon
07/13/2022, 4:40 PMcreece
07/13/2022, 4:59 PMcreece
07/13/2022, 5:08 PMalien4u
07/13/2022, 5:15 PMcreece
07/13/2022, 5:16 PMbattk
07/13/2022, 5:17 PMbattk
07/13/2022, 5:17 PMcreece
07/13/2022, 5:18 PMalien4u
07/13/2022, 5:25 PMredirect.toRecord({
type: 'creditmemo',
id: scriptContext.newRecord.id,
});
alien4u
07/13/2022, 5:26 PMcreece
07/13/2022, 5:26 PMcreece
07/13/2022, 5:27 PMbarinvon
07/13/2022, 5:28 PMbarinvon
07/13/2022, 5:33 PMurl.resolveRecord({
recordType: 'creditmemo',
recordId: cmId,
isEditMode: true,
params: { 'whence': [what would go here?] }
});
alien4u
07/13/2022, 5:34 PMbattk
07/13/2022, 5:34 PMbattk
07/13/2022, 5:34 PMbattk
07/13/2022, 5:35 PMbattk
07/13/2022, 5:35 PMcreece
07/13/2022, 5:40 PMrequire(['N/url', 'N/record'], function(url, record) {
function doRedirect() {
var redirectUrl = url.resolveRecord({
recordType: record.Type.CREDIT_MEMO,
isEditMode: true,
params: {
entity: 4779
originalCreditMemoId: 12345
}
});
window.open(redirectUrl);
}
doRedirect();
});barinvon
07/13/2022, 5:41 PMcreece
07/13/2022, 5:43 PMcreece
07/13/2022, 5:43 PMbattk
07/13/2022, 5:48 PMbattk
07/13/2022, 5:49 PMcreece
07/13/2022, 5:54 PMvar sendUser = url.resolveRecord({
recordType: 'creditmemo',
recordId: cmId,
isEditMode: true
});
sendUser += '&whence=&e=T&memdoc=0";
window.location = sendUser;
battk
07/13/2022, 6:02 PMbattk
07/13/2022, 6:03 PMcreece
07/13/2022, 6:03 PMbattk
07/13/2022, 6:04 PMcreece
07/13/2022, 6:26 PM