Actually I am trying to get list of all my previous labels from DB and if same label is there already I am trying to concatenate with product.
But frappe raises error.
I am trying from server side.
Any suggestions thanks in advance.
class Samplefrappe(Document):
def validate(self):
self.label = self.label[0:140]
finalname = self.label+self.product
frappe.msgprint(finalname)
metric=[]
c=frappe.db.get_list(‘Samplefrappe’,fields=[‘label’],as_list=True)
for i in c:
metric.append(i)
frappe.msgprint(metric)
if self.label not in metric:
self.label = self.label[0:140]
else:
self.label = finalname
def autoname(self):
self.name = self.label[0:140]