Iterate Items in DeliveryNote


How can we iterate through all the items in a delivery note? For each of the item, I would like to examine the brand. Let’s say for now we just display a dialog for the brand.



$.each(cur_frm.doc.items, ...

Sorry, I don’t have time to try until today. But it’s not working. Perhaps the syntax is not right. Where can I get debugging information?

If it helps…

I use this code when the project is updated and items in purchase order need to be updated to the same project.

   $.each(doc.items, function(i, d) {
	//msgprint("project: "+d.project+" parent: "+cur_frm.doc.project);
	d.project = cur_frm.doc.project;

That’s great, snippet is helpful.
It would be more helpful for beginner like me if you provide some sample code also.
My task is to limit rate field of items in Sales Invoice Item Doctype as non-zero.

Keep the good work going.
Thank you folks.