I’m trying to copy relevant fields into a new document. The parent fields are getting copied but not the child table. Any assistance will be much appreciated. Below is my code:
Thanks a lot for responding but this code seems to only copy the child table into the current doc from another doctype. What I am trying to do is to copy the child table from the current doc into a new document
you can pull data to new document, you don’t need to push. if you try to create doc/docs via data from table in current doc you have to insert them to db directly.
It seems strange to me that there’s no straightforward way of pushing the child table while fields on the parent doc are getting pushed without any issues? Why can’t child table fields be conveyed in the same payload? Is this a design problem?
In any case, thanks again for your response. Based on your comments, I solved the issue by pulling on the New Doc side (using refresh trigger). Still think it should be a more straightforward process though
Thank you for the wonderful contribution.
Through your code, I was able to do the same.
My requirement was exactly reverse of yours, but still the code helped very much.
It took some trial an error and I succeeded.