How to add name/status text form to stamp

A picture is worth a thousand words. We have created some pdfs tutorials showing common tasks.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
melfnaus
User
Posts: 2
Joined: Mon Dec 16, 2019 11:02 pm

How to add name/status text form to stamp

Post by melfnaus » Mon Dec 16, 2019 11:30 pm

Hey all!

I´d like to know how to add a name/status to a dynamic stamp using javascript.
Using another pdf program I used the script below so that a pop up box appears once you placed your stamp and you manually enter your name and the status of the document being reviewed.

var cAsk = "Status: Approved, Rejected, or In Process";
var cTitle = "Document State For Stamp";

if(event.source.forReal &&
(event.source.stampName == "#stamp1"))
{
event.value = app.response(cAsk, cTitle);

}

-------------------------------------------------------------------------------------

var cAsk = "Enter a name";
var cTitle = "Document State For Stamp";

if(event.source.forReal &&
(event.source.stampName == "#stamp1"))
{
event.value = app.response(cAsk, cTitle);
}

I have resolved the name/identity part using this script: (but prefer to do this manually)

if((identity.name != null) && !/^\s*$/.test(identity.name))
event.value = identity.name;
else
event.value = identity.name.replace(/\./g," ").replace(/\./g," ").replace(/\b(\w)/g,function(Word,cFst){return cFst.toUpperCase()});


What would be the best way forward?

Thanks in advance! :D

User avatar
TrackerSupp-Daniel
Site Admin
Posts: 2882
Joined: Wed Jan 03, 2018 6:52 pm

Re: How to add name/status text form to stamp

Post by TrackerSupp-Daniel » Mon Dec 16, 2019 11:39 pm

Hello Melfnaus,

From what I can see, this JS works correctly in our application as is, you simply need to create a stamp with a form field to contain it, then input the new stampName. This article should help:
https://www.tracker-software.com/knowle ... p-Creation

Kind regards,
Daniel McIntyre
Support Technician
Tracker Software Products (Canada) LTD

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

melfnaus
User
Posts: 2
Joined: Mon Dec 16, 2019 11:02 pm

Re: How to add name/status text form to stamp

Post by melfnaus » Tue Dec 17, 2019 2:16 am

Thanks for testing it out!

I had a look at the link that you sent and I can't seem to find the Stamp Id in properties.
Please refer to the snip below with what appears when I select the stamp
Capture_01.JPG

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13769
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to add name/status text form to stamp

Post by Tracker Supp-Stefan » Tue Dec 17, 2019 2:55 pm

Hello melfnaus,

Please make sure you are using the latest Editor build, and that you are adding the stamp from a stamp collection and not e.g. through JS code executed in the JS console - and you should see the Stamp ID there:
Stamp_ID.png
Stamp_ID.png (19.17 KiB) Viewed 82 times
Regards,
Stefan

Post Reply