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

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.