How to upload a file and rename an attachment using a UI action?

Ed23
Tera Contributor

Hello,

 

I want to upload a file and after uploading the file, change the file name to "Doc" + file extension.

 

I have this script but when I add something after "saveAttachment(g_form.getTableName(), g_form.getUniqueValue());" it doesn't run.

cap.png

 

Regards.

6 REPLIES 6

Hello @Samaksh Wani ,

 

I did what you say but it doesn't work, it doesn't show the pop-up to attach a file and does not rename it.

 

Regards.

Hello @Ed23 

 

Add this Script in UI Action, You will get the Pop up Open.

 

 

var uiPageSysId = 'b1b390890a0a0b1e00f6ae8a31ee2697'; // pass ui page sys_id here
var url = '/ui_page.do?sys_id=' + uiPageSysId;
g_navigation.open(url, '_blank');

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh