<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tushar Raina</title>
    <description>The latest articles on DEV Community by Tushar Raina (@tushar1337).</description>
    <link>https://dev.to/tushar1337</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F741785%2Ffc294c11-3113-4488-88b0-1ac17f54939a.png</url>
      <title>DEV Community: Tushar Raina</title>
      <link>https://dev.to/tushar1337</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tushar1337"/>
    <language>en</language>
    <item>
      <title>How to update data of child table in web form using client script in Frappe Framework</title>
      <dc:creator>Tushar Raina</dc:creator>
      <pubDate>Wed, 05 Apr 2023 08:00:32 +0000</pubDate>
      <link>https://dev.to/tushar1337/how-to-update-data-of-child-table-in-web-form-using-client-script-4g0e</link>
      <guid>https://dev.to/tushar1337/how-to-update-data-of-child-table-in-web-form-using-client-script-4g0e</guid>
      <description>&lt;p&gt;how can I use the same client script which is basically updating the value of rows in the child table from the data coming from an external API and is working for the doctype form to work with the web form client script? the data is coming but the rows are not updating &lt;/p&gt;

&lt;p&gt;The Script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function updateCateringLimits(frm, responseMessage) {
   frappe.call({
      method: 'frappe.wis.doctype.script.get_catering_limits',
      args: {
         buid: frm.doc.buid,
         office_guid: responseMessage[frm.doc.officename]
      },
      callback: function (response) {
         const cateringLimitsObj = response.message;
         const cateringLimits = Object.values(cateringLimitsObj)[0];
         const childTable = frm.doc.catering_limits || [];

         // Clear the child table first
         while (childTable.length) {
            frm.get_field('cateringlimits').grid.remove_row(0);
         }

         // Add the new rows to the child table
         const childTableField = frm.fields_dict['cateringlimits'];
         if (childTableField &amp;amp;&amp;amp; childTableField.grid) {
            cateringLimits.forEach(cateringLimit =&amp;gt; {
               const newRow = frm.add_child('cateringlimits');
               newRow.minpeople = cateringLimit.minPeople;
               newRow.maxpeople = cateringLimit.maxPeople;
               newRow.cutoff = cateringLimit.cutoffHrs;
            });
         }

         // Refresh the form to show the updated child table
         frm.refresh_field('cateringlimits');
      }
   });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am trying to update my doctype script which is updating the rows of child table in doctype form but the script in not working in the web form client script i have tried to make changes and the code is working till wher it is able to fetch the data from the api but the grid is not updating&lt;/p&gt;

</description>
      <category>frappe</category>
      <category>erpnext</category>
    </item>
  </channel>
</rss>
