Copy link to clipboard
Copied
Hi
My scenario is this. I am making batches of medicine - lets call it MED
I can make multiple batches per day (i.e. batch 1, 2, 3)
I would like an identifier to identify which batch of MED it is.
I want the user to select the date of production in one cell (e.g. 27/04/2023) and automatically fills the other cell with the batch number in the format of (20230427-MED-n) where n is 1,2,3 and can be edited by the user.
Is this possible?
Use something like this as 'Validate' script in 'Date' field:
var str = event.value;
var s = str.split("/");
if(event.value)
this.getField("Text2").value = s[2]+s[1]+s[0]+"-MED-n";
else
this.getField("Text2").value = "";
Just change "Text2" to the name of the field where you want to show that text.
Copy link to clipboard
Copied
Use something like this as 'Validate' script in 'Date' field:
var str = event.value;
var s = str.split("/");
if(event.value)
this.getField("Text2").value = s[2]+s[1]+s[0]+"-MED-n";
else
this.getField("Text2").value = "";
Just change "Text2" to the name of the field where you want to show that text.
Copy link to clipboard
Copied
Thanks Nesa. You're amazing! Saved me once more!
Copy link to clipboard
Copied
It would be possible but you would need to enlist the help of a javascript author to make it happen. You would need to consider how the 1,2,3 are differentiated. 3 different files?