Home > Forum > Tips&Tricks > barcode unique across application?

barcode unique across application?
0

In reply to: Daniel Krüger (Cosmo Consult)

Hi Marcin,

which barcode are you referring to? If you add a barcode using this action
https://community.webcon.com/posts/post/the-add-a-barcode-action/62

The instance id will be part of it. This will be unique across all applications in the same database.


Best regards,
Daniel

We have own barcode tapes and i wonder how prevent add two workflow with the same barcode. Barcode field is on the form. The only solution is check database by sql query? where this query should by placed?

MVP
In reply to: Marcin

We have own barcode tapes and i wonder how prevent add two workflow with the same barcode. Barcode field is on the form. The only solution is check database by sql query? where this query should by placed?

Hi Marcin,

sorry, I probably got it wrong. So you just need to check if the value in a field is unique. I've a similar use case and wanted to display in the browser an alert to the user, whether the value is already used.

I created this business rule:

select {WFCONCOL:59}
from WFElements
where {WFCONCOL:72} = '{72}'
and WFD_DTYPEID = {DT:3}
and WFD_COMID = {COM_ID}
and WFD_ID <> {WFD_ID}

And used in the business rule in "Form rule to be executed on value change" if the return value is not empty, I clear display an alert and clear the value.

From the above query you need to change the document type {DT:3} and the field condition {WFCONCOL:72} = '{72}'. In the later one I compare the data stored in the column against the current one.
I'm returning another column because I used this text in the alert message.

Depending on how you are using this, you could use a validate action to verify that it's unique.

Best regards,
Daniel

Did you know that with WEBCON you can automate virtually any process? Even baking cookies 🍪
 
Speaking of cookies: we use the ones that are essential for our website to function properly, as well as additional ones that help us customize our content to your preferences. If you don’t mind cookies, click Accept. If you want to learn more, explore settings.
Settings