Set Property Dynamically

20 views
Skip to first unread message

Rohit Waghchaure

unread,
Mar 22, 2013, 3:09:51 AM3/22/13
to erpnext-dev...@googlegroups.com

   Hello sir

                i want to add set property dynamically in to the database table tabDefaultValue for that i have written following code
        ab = Document('tabDefaultValue')
                        ab.parentfield='system_default'
                        ab.parenttype='Control Panel'
                        ab.parent=self.doc.name
                        ab.defkey='Store'
                        ab.defvalue = self.doc.store
                        ab.save(new=1)
 
  But it gives an error
          (1146, "Table 'mtn_erp.tabtabDefaultValue' doesn't exist")
 So please help me to solve this problem.

Thanx & Regards
Rohit


Nabin Hait

unread,
Mar 22, 2013, 3:15:59 AM3/22/13
to erpnext-dev...@googlegroups.com
DefaultValue is a child table of "Profile", not "Control Panel". And doctype name is "Default Value", table is "tabDefault Value".

Regards,
Nabin Hait

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/lWQT_E0ZOZEJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Rushabh Mehta

unread,
Mar 22, 2013, 3:18:09 AM3/22/13
to erpnext-dev...@googlegroups.com
Please use webnotes.defaults module to get / set defaults.


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

Nabin Hait

unread,
Mar 22, 2013, 3:19:41 AM3/22/13
to erpnext-dev...@googlegroups.com
Sorry, "DefaultValue" is linked to both "Control Panel" and "Profile"

Regards,
Nabin Hait
Reply all
Reply to author
Forward
0 new messages