Skip to main content
Participant
May 20, 2022 12:09 AM UTC
Question

Dynamic stamp not populating with the information

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 is closed to new replies. Start a new post to keep the conversation going.

10 replies

bebarth
Community Expert
Community Expert
May 20, 2022 7:41 AM UTC

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...

@+

Translate
Participant
May 20, 2022 8:07 PM UTC

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.

Translate
try67
Community Expert
Community Expert
May 20, 2022 8:19 PM UTC

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?

Translate
Bernd Alheit
Community Expert
Community Expert
May 20, 2022 4:32 AM UTC

Remove one source. What does you get?

Translate
Participant
May 20, 2022 8:02 PM UTC

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

Translate