Combine multiple field entries into one field with "-" separations
I have three specific fields in a PDF form that I would like to combine into a single field (that is then used for filenaming later on).
Currently I have the three field appearing as a string of numbers, but I would like a "-" (dash) between each field (so the filename is easier to decode).
Currently I have the following:
Run custom validation script:
event.value = event.value.replace(/\D/g, "");
Custom calculation script:
var s = this.getField("exchange_date").valueAsString + this.getField("part_origin").valueAsString + this.getField("kr_art_nr").valueAsString;
event.value = s.replace(/^, |, $/g, "");
but with this it correctly removes the '/" from between the yyyy/mm/dd to present it correctly as yyyymmdd, but I would like everything to appear as follows:
exchange_date-part_origin-kr_art_nr
20240529-123456-987654
Been battling this for a few hours and cannot seem to find the trick to make this work!
Much appreciate your help.