Accessing the grid table data on server side

Hi


I have a header portion and grid portion on a form
How can I access the grid table data in the server side validate() function
I tried getchildren() method but it fetches from the database

What i want is to validate the data in the grid table before saving into the database

Thanks
Arun



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

If you have pulled the latest changes then,

self.doclist.get({doctype:"Table DocType"})


W: https://erpnext.com
T: @rushabh_mehta

On 03-Dec-2012, at 2:43 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

I have a header portion and grid portion on a form
How can I access the grid table data in the server side validate() function
I tried getchildren() method but it fetches from the database
What i want is to validate the data in the grid table before saving into the database

Thanks
Arun



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi

I am getting an error " AttributeError: 'list' object has no attribute 'get'"

Thanks

On Mon, Dec 3, 2012 at 2:54 PM, Rushabh Mehta <rm…@gmail.com> wrote:

If you have pulled the latest changes then,

self.doclist.get({doctype:"Table DocType"})


W: https://erpnext.com
T: @rushabh_mehta

On 03-Dec-2012, at 2:43 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

I have a header portion and grid portion on a form
How can I access the grid table data in the server side validate() function
I tried getchildren() method but it fetches from the database
What i want is to validate the data in the grid table before saving into the database

Thanks
Arun



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Ok - it might not be merged

try

filter(lambda d: d.doctype=="Table DocType", self.doclist)

basically the doclist object contains the parent + child records. You will have to filter out in case you do multiple records.

- Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 03-Dec-2012, at 2:58 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi
I am getting an error " AttributeError: 'list' object has no attribute 'get'"

Thanks

On Mon, Dec 3, 2012 at 2:54 PM, Rushabh Mehta <rm...@gmail.com> wrote:
If you have pulled the latest changes then,

self.doclist.get({doctype:"Table DocType"})


W: https://erpnext.com
T: @rushabh_mehta

On 03-Dec-2012, at 2:43 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

I have a header portion and grid portion on a form
How can I access the grid table data in the server side validate() function
I tried getchildren() method but it fetches from the database
What i want is to validate the data in the grid table before saving into the database

Thanks
Arun



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

HI Rushabh


Thanks for your help
Its working now

Thanks and regards
Arun

On Mon, Dec 3, 2012 at 3:07 PM, Rushabh Mehta <rm…@gmail.com> wrote:

filter(lambda d: d.doctype=="Table DocType", self.doclist)



You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.