Copy link to clipboard
Copied
Hello people
I have read through countless postes and am unable to figure out how to get this stamp to work
text 1 workes perfectly as a automatic date
i need text 2 to be just a regular text feild so when i wherever on the screen i can then add a 6 digit number ex 416051 not more not less
Much aprechiated
Copy link to clipboard
Copied
Stamps don't work like that. Once you apply them all the fields in them become flattened. You have to prompt the user to enter the value for this field when the stamp is applied, and then populate it into the field. After the stamp is applied it can't be edited any longer. You can only delete the stamp and re-apply it using a new value.
Copy link to clipboard
Copied
Hello try
You seem like a expert so i would love to ask for your help with a dynamic stamp problem of mine.
I have a dynamic stamp with many fields which are filled by: value = app.response(""). in some cases i don't need the script to ask for all the fields so it would be nice that whit some kind of input in the app.response-pop-up i could end the script prematurely. I hope you understand my problem. English and Coding are not my native languages..haha
Thanks in advance
Timo
Copy link to clipboard
Copied
If you want to include logic in determining which values to prompt the user to enter using a dialog object might be a better idea. This is not a trivial scripting task, though.
Copy link to clipboard
Copied
To be placed in calculation script of the Text2 field:
var answer="";
while (!/^\d{6}$/.test(answer) && answer!=null) {
var answer=app.response({
cQuestion: "Enter a 6-digit number.",
cTitle: "Reference",
cLabel: "MAXIMO #",
});
}
if (answer!=null) event.value=answer;
else event.value="";
Copy link to clipboard
Copied
If you do that it will prompt you to enter the value even when you just preview the stamp in the stamps list...
Copy link to clipboard
Copied
I understand what try67 is meaning, so write:
if(event.source.forReal && event.source.stampName=="#Received") {
var answer="";
while (!/^\d{6}$/.test(answer) && answer!=null) {
var answer=app.response({
cQuestion: "Enter a 6-digit number.",
cTitle: "Reference",
cLabel: "MAXIMO #",
});
}
if (answer!=null) event.value=answer;
else event.value="";
}
...and in the script, change the stamp name "#Received" by the one indicated in the template of your stamp.
Copy link to clipboard
Copied
What if you don't want to limit it to six characters, and want to allow letters as well as numbers?
Copy link to clipboard
Copied
Then don't use the conditional code at all. Just this:
if(event.source.forReal && event.source.stampName=="#Received") {
event.value=app.response("Enter the value for this field:");
}
Copy link to clipboard
Copied
Hi,
Me I suggest this script to avoid the stamp from displaying "null":
if(event.source.forReal && event.source.stampName=="#Received") {
var answer=app.response({
cQuestion: "Enter a reference.",
cTitle: "Reference",
cLabel: "MAXIMO #",
});
if (answer!=null) event.value=answer;
else event.value="";
}
@+