Skip to main content
New Participant
May 20, 2022
Question

Dynamic stamp not populating with the information

  • May 20, 2022
  • 2 replies
  • 2789 views

I'm creating my very first custom dynammic stamp to apply to exhibits used in court. 

I want the file name to automatically appear on the stamp. 

I've created the tesx field and added the following custom calculation script:

event.value = event.source.source.documentFileName.replace(".pdf", "");

Nothing happens when I apply the stamp to a document. The stamp appears, but no file name appears on the stamp.

Any suggestions as to what I've done wrong?

This topic has been closed for replies.

2 replies

bebarth
Community Expert
May 20, 2022

Hi,

Your script seems correct. If you remove one "source" you should get the name of the stamp file.

To get the name of the stamp file, just type event.value=this.documentFileName;

Do you only have this script in your stamp? It's maybe an other one which stops this one.

...and just a suggestion, if you want to remove the .pdf extension you shoud write:

 

event.value = event.source.source.documentFileName.replace(/.pdf$/i, "");

 

This will remove only the extension and is case-insensitive.
Try my attached stamps...

@+

New Participant
May 20, 2022

So good and bad news.

1st - this is the only script in my stamp;

2nd - if I replace what I had with: 

event.value = event.source.source.documentFileName.replace(/.pdf$/i, "");

I still get nothing. I was beginning to suspect that my stamps was just badly designed and not working, but I used:

event.value=this.documentFileName;

and the stamp populated with the name of the stamp file, which isn't my goal. However, I know the stamp is able to populate information, just not the information I'm looking for.

try67
Community Expert
May 20, 2022

The code you're using is fine, so maybe the issue is with the stamp itself, or maybe you're not placing it in the correct place. Could you share your stamp file with us?

Bernd Alheit
Community Expert
May 20, 2022

Remove one source. What does you get?

New Participant
May 20, 2022

If I remove one "source", I still get nothing.