Skip to main content
Participating Frequently
September 24, 2020
Answered

Editable Dynamic Stamp

  • September 24, 2020
  • 1 reply
  • 2906 views

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 has been closed for replies.
Correct answer try67

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);


}

1 reply

try67
Community Expert
Community Expert
September 24, 2020

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);

pyerardiAuthor
Participating Frequently
September 25, 2020

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

pyerardiAuthor
Participating Frequently
September 25, 2020

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;

}