How use erpnext.utils.map_current_doc

I need more clarification on this method:


How to use it and when ?
could give some example please

Hi @Mohammed_Redha

This method is used to pull the data from another form to current form for example I am on sales invoice and I want to pull the data from the sales order, see below GIF for more details

Code of the above example
JS code:

PY code: