Attachment version renaming

Debasis Pati
Tera Guru

While uploading a attachment in submission record if a attachment is already there and a same named attachement is getting attached it should rename the new attached document as a version.

For example Test.txt is there again if i attach Test.txt it should get attached and renamed as Test_V1.txt

so now my record should have 2 attachment records as Test.txt,Test_V1.txt

@Ankur Bawiskar Can you help in this.


Regards,
Debasis

14 REPLIES 14

@Debasis Pati 

you are updating the field

BR is in which scope?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar 
custom application scope the br is also created in the same scope but updating the attachment  records name.

Hello @Ankur Bawiskar ,

It worked when i wrote the br on global scope 
but it is always creates v2 only 

DebasisPati_0-1713519535401.png

I had Test1 file first time it created Test1_V2 but when again i uploaded it created again a Test1V2 rather it should create Test1V3

Regards,
Debasis

 

 




@Debasis Pati 

you will require tweak as I mentioned in my earlier script.

how will you know if Test1.txt and Test1_V2.txt are same without knowing the content

Simply relying on file name to add versions won't help.

I think you should discuss this requirement with your customer. I feel it's a weird requirement.

but anyhow I have provided an approach which works and it will require some tweaks.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Debasis Pati 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader