Hi, I am Gaurav . I am working on frappe and ERP. There is no Channel to do this in programatical way. Thanks and make more videos from coding point of view also
To insert rows into a child table, without overwriting existing ones, use the `append` method. This adds new rows without affecting what's already there. Here's a simple example: def before_save(doc, method): if doc.some_field == "some_value": new_row = doc.append('items', {}) new_row.item_code = 'ITEM001' new_row.qty = 10 if doc.other_field == "other_value": new_row = doc.append('items', {}) new_row.item_code = 'ITEM002' new_row.qty = 5 This way, new rows are added only if the condition is met, and existing rows stay untouched.
I love you ,God save and bless you, you are the best
@@mhmedRjb Thanks 😊👍
This is awesome, Keep up!
Hi, I am Gaurav . I am working on frappe and ERP. There is no Channel to do this in programatical way. Thanks and make more videos from coding point of view also
Thanks 🙂👍
Good 💯
How do I insert rows everytime based on some condition in server side script ? It is always overriding existing values ?
To insert rows into a child table, without overwriting existing ones, use the `append` method. This adds new rows without affecting what's already there. Here's a simple example:
def before_save(doc, method):
if doc.some_field == "some_value":
new_row = doc.append('items', {})
new_row.item_code = 'ITEM001'
new_row.qty = 10
if doc.other_field == "other_value":
new_row = doc.append('items', {})
new_row.item_code = 'ITEM002'
new_row.qty = 5
This way, new rows are added only if the condition is met, and existing rows stay untouched.
how you can check the field names from here?
Just press "alt" button