I'm wondering why only one a several record validations won't fire.
In my cdxml file I have:
<dDropdownList sizerInfo="{'RowSpan': 1, 'ColSpan': 1, 'HAlign': 'Left'}"
Name="dDropdownList3" rowColPos="(0, 1)" Choices="[u'- Select Extra
Type -', u'Dallas Change Order', u'Dallas Extra']"
Keys="[u'0', u'DC', u'DEX']" ValueMode="key"
Width="129" designerClass="controlMix" DataSource="projectextras"
RegID="ddType" DataField="type"></dDropdownList>
In my bizobj validation method I have:
def validateRecord(self):
"""Returning anything other than an empty string from
this method will prevent the data from being saved.
"""
msgs = []
# Add your business rules here.
if self.Record.type == 0:
msgs.append("You must select a project extra type")
if self.Record.builderfk == 0:
msgs.append("You must select a builder")
if self.Record.projectfk == 0:
msgs.append("You must select a project")
if self.Record.contactfk == 0:
msgs.append("You must select a contact")
if msgs:
return "The project extra '%s' could not be saved because:\n" \
% self.Record.type.strip() + "\n".join(msgs)
return ""
Everything fires correctly in this validation method except the first one:
if self.Record.type == 0:
msgs.append("You must select a project extra type")
It allows me to save even if type equals 0
Does this have something to do with the fact that my choice and key are in
the cdxml file as opposed to creating a method to populate choice and keys
in my -code.py file?
-- Carey
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]