...
api.currentItem() returns temporary object in “Autosave off” mode.
It’s not possible to check empty typedId or uniqueName to know if the document was saved initially. This can be done by checking persistedClicId attribute.
Be careful with api.find(), you may need to compose and use the “real” typedId instead of the typedId of the temporary data.
In “Autosave off” mode, the line items also have a different type code: QLITMP instead of QLI.
...