Development of "last selling price"

There is a requirement among clients in this area of the world to see the “Last selling price for current item” during creation of a Selling document. A pre made pricelist isn’t really serving the purpose.

 I would like to develop this feature and make it available to the community,I would like to discuss the ideal way to implement this feature.
  1. Add a field “last_selling_price” in “Quotation Item” table
  2. Set “last_selling_price” on change of “item code”.
    i) Use frappe.ui.form.on fucntion for onchange event.
    ii) Call a server side function using
    iii) In server side function, return last selling price using query (frappe.db.sql)