Barcode for each document and take me to that document name

Thanks for your help here! I have used the code - in a custom html field on our sales invoice documents. It generates a QR code, but when I scan the QR code, it does not fetch the url of the document. Rather, it wants to initiate a browser search for {{frappe.utils.get_url_to_form(doc.doctype, doc.name)}}. Do you have any advice on how the coding of the text can be corrected?

Here is my custom HTML code if it helps :

> <p><img style="display: block; margin-left: auto; margin-right: auto;" src="http://bwipjs-api.metafloor.com/?bcid=qrcode&amp;text={{frappe.utils.get_url_to_form(doc.doctype, doc.name)}}" height="100" /></p>

But I only put it in Print Format, not in doctype custom field :

Ah - that makes sense - I was adding it to the custom field! Thankyou!

1 Like

Hi @FredericVerville

I encountered an error: “Invalid key.” Could you please assist me in resolving this issue?

I just came across your solution here. I was trying the same thing. While the QR code is generated and properly included in the print, when I try the URL it tells me “Invalid key”. Is there anything else that needs to be done to enable the key that is generated?