- This topic has 4 replies, 2 voices, and was last updated 2 years, 2 months ago by Travis P..
-
AuthorPosts
-
10 September 2024 at 4:08 am #8535FMFran M.
Good morning,
I am trying to create a barcode with the GenerateMatrixBarcode function of the codeunit: “IWX Library – Barcode Gen”. , in BC, The text I want is: TBOTE||DML.F|DCC Chromogen Concentrate|||||
and it returns this:
Error message:
Bad Request
Timestamp in error:
2024-09-10T10:12:37.6049027Z
AL call stack:
“IWX Library – Barcode Gen”(CodeUnit 23044800).GetResponse line 44 – Barcode Generator by Insight Works “IWX Library – Barcode Gen”(CodeUnit 23044800).Generate MatrixBarcode line 33 – Barcode Generator by Insight Works “IWX Barcode Generation”(Report 23044800).generateDataMatrixBarcode line 2 – Barcode Generator by Insight Works “IWX Barcode Generation”(Report 23044800).”diInteger – OnAfterGetRecord”(Trigger) line 6 – Barcode Generator by Insight Works
However, if I change the text to ||DML.F|DCC Chromogen Concentrate|||||, it works and generates it for me, as if it had a character limit. I have done tests and it only allows me up to 40 characters
10 September 2024 at 10:48 am #10019TPTravis P.Insight WorksThe barcode text field allows up to 1024 characters, so the text is not too long, but the report that you are using may have a restricted field length:
You can use the “Sample Barcode List” page to interactively test your data to see if it is applicable for the settings without having to edit the report for each attempt. In “List” view you can fill in the text that you want in the barcode and then switch to “Tall Tiles” view to see the resulting barcode. When I enter your text there it is able to produce a barcode that scans correctly.
Report source for the sample barcode reports can be found here so you can see some examples of the barcodes to use in your own reports:
11 September 2024 at 1:31 am #10020FMFran M.What was mentioned in the first post is from the page of the installed extension “IWX Barcode Generation”, since the same thing happened in my report:
Options
Barcode Content: TBOTE||DML.F|DCC Chromogen Concentrate|||||
Barcode Format:Data Matrix
Data Matrix Options
Barcode Multiplier:8
Barcode Image Size: 24×24
Error: Bad Request
However, this works:
Options
Barcode Content: ||DML.F|DCC Chromogen Concentrate|||||
Barcode Format:Data Matrix
Data Matrix Options
Barcode Multiplier:8
Barcode Image Size: 24×24
11 September 2024 at 2:38 am #10021FMFran M.I have seen that it is based on the image sizes and multiplier.
I need a way that, if it returns the bad request error, I can continue with another code, control the error, but without the code of the codeunit “IWX Barcode Generation” I cannot do a [tryfunction]
Is there any way to get the code?
11 September 2024 at 8:30 am #10023TPTravis P.Insight WorksBecause you are trying to include symbols, the character limit is less than if plain text was used. This limit is from the matrix barcode protocol itself, not the Barcode Generator app. The barcode images are evaluated and generated by an online service, so it is not something that you can test in code.
When testing on the Sample Barcode List page, the size needs to be at least 26×26 in order to handle more than 40 characters with symbols. Note that if the size is not specified, it will use automatic sizing which works well with the text that you provided. You do need to switch lines on that page before changing the view in order to commit the changes.
Because the report cannot change it’s format on the fly, the barcode needs to be designed for the worst case scenario, so make sure that you are testing the largest possible string that you could ever use, not just the biggest string that is currently entered.
-
AuthorPosts
- Sign in below to reply.