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&apos;- Select Extra
Type -&apos;, u&apos;Dallas Change Order&apos;, u&apos;Dallas Extra&apos;]"
Keys="[u&apos;0&apos;, u&apos;DC&apos;, u&apos;DEX&apos;]" 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]

Reply via email to