Skip to main content
Participating Frequently
Sep 24, 2020 6:05 PM UTC
Answered

Editable Dynamic Stamp

I'm having trouble with my code (I think). I have a dynamic stamp created and have added 2 text fields. One to enter the document # and one to prompt the user to enter the Revision. The code for the document # was easy thanks to this board.

event.value = event.source.source.documentFileName.split(".").shift();

However, I cannot figure our the code to promt the user to enter the revision. The code i have is:

if ((event.source.forReal)&&(event.source.stampname == "#GHhz9-BkcmvhZfa7GtQxrA"))
{
event.value("Revision").value = app.response(cAsk, cRevision);
}

But it does nothing. Any help for a novice would be awesome.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Oct 2, 2020 7:06 PM UTC

No paperclip to attach file. Only an image or a video.

I created a download link:

https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:73badc84-0c78-46a0-bb58-21c480062a0b

It's the last stamp in the pdf file.


You have multiple errors in your code. The main one being that the stampName (not stampname...) is not the same as the file name. Use this code:

 

if ((event.source.forReal)&&(event.source.stampName == "#_OMXiRb9vvDgKPJ3Ce0dsB"))
{
var cAsk = "Enter Revision";
var cRevision = "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R";
event.value = app.response(cAsk, cRevision);


}

16 replies

try67
Community Expert
Community Expert
Sep 24, 2020 10:13 PM UTC

Is that the full code? Where's the definition of the cAsk and cRevision variables?

Also, change this:

event.value("Revision").value = app.response(cAsk, cRevision);

To:

event.value = app.response(cAsk, cRevision);

Translate
pyerardiAuthor
Participating Frequently
Sep 25, 2020 11:31 AM UTC

Try67, Thank you. I'll research "variables". I didn't see any in samples I had looked at.

Translate
pyerardiAuthor
Participating Frequently
Sep 25, 2020 1:17 PM UTC

I've added variables but still not working. cade so far:

if ((event.source.forReal)&&(event.source.stampname == "#GHhz9-BkcmvhZfa7GtQxrA"))
{
event.value = app.response(cAsk, cRevision);
event.value = cMsg;
var cAsk = "Enter Revision";
var cRevision = "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R";
   event.source.source.info.Revision = cMsg;

}

Translate