Your code will run after had changed on item_code field
And once changing item code and select the item, the rate and quantity of this item will, of course, be 0
So you need to change this trigger to handle rate and qty changing
yes, my code will run after item_code get value, but fails to get row.rate.
i think system default is also triggering item_code field for loading item details (such as item name, description, price) into child table. but my code is fired a bit earlier (or at same time with system triggering item_code changing) so rate and qty field have not been fetch yet.
i would like my script will get fired on item_code, but after system fetching item details to ensure rate and qty value are available.
Hi,
can you please post a screenshot of your child and parent doctypes with your “custom fields added” so i can see the fields you want to use. If i understand you correctly, you need to first save then calculate so everything is fetched and the correct values are set. you can save first and then trigger a recalculation of your table upon saving.