Need to Fetch data in Print for Submitted Doctype

Dear Community,

Recently am updated building name in system but i submit sales invoice before uploaded these data.
but i need to fetch these data in print even i tried code it not work can you please help me to fetch the data in print

Doctype is Property, Field name is custom_building_name

Building Name:{{ frappe.db.get_value("Property", doc.property,"custom_building_name")) }}

by using this code in print it shows as None bcs of not available in sales invoice.

so i need directly fetch from property doctype.

Reference:

thanks for the response, but here the sales invoice is already submitted. so it not fetch tha building name in print even it only take none bcs of not available in sales invoice.

If the document is already submitted and you want to make any changes to it, why not just cancel and amend it?

If you don’t want to cancel but just take a print, why not just give the property value statically just for this print alone? And change it back to dynamic jinja once you’ve taken your print?

they are 50 invoices now only these data added hence i tried via print code.