Batch Applying Price Books !!

Batch Applying Price Books !!

Hi,

so, I have been studying Deluge now for a while and made it quite far. 

I and many others in this Forum share some common requests which a far overdue, like 7+ years old! 

And most of them are already possible with custom buttons and deluge but should be already integrated, like combining Sales Order together into Purchase Orders or Invoices. While I have succeeded in that, I have been trying to find a way to BATCH apply a price book to a Sales Order/Invoice/Purchase Order on button click. 

And the CRM infrastructure has it all! All the needed details are accessible, the only problem is, that the value "books" in Product Details apparently can't be overwritten with Deluge. Which is absolutely sad. Otherwise my code below should work. I am certain of it.

Would be really appreciated if you could give us access to overwriting this field in the near future, thanks!

//Fetch Invoice Account
v = zoho.crm.getRecordById("Invoices",vId);
v_id = v.get("Account_Name").get("id");
//Fetch Related Price Book
books = zoho.crm.getRecords("Price_Books");
for each  book in books
{
book_account = book.get("Account").get("id");
if(book_account == v_id)
{
related_book = book.get("id");
}
}

//Apply Price Book
pdlist = List();
pdet = v.get("Product_Details");
for each  prod in pdet
{
mp = Map();
mp.put("book",related_book);
}
update = zoho.crm.updateRecord("Invoices",vId.toLong(),mp);