If you have this kind of error, check your validateForSave method. Maybe do you just forget to call super.validateForSave()?
There is nothing related to D2W or NSTimestamp attribute. And initializing your attribute with "now" is crap. If your users delete the value you will have fixed nothing. Put a breakpoint and trace your code. Philippe --------------------- http://twitter.com/prabier Sent from my iPad > On 22 juil. 2014, at 21:41, Theodore Petrosky <[email protected]> wrote: > > I have a simple D2W app that creates pdfs from various data. I have a report > that requires minimally choosing a client, a location and a date for the > event. > > When I am creating a new report, my fields client, date, and location are > marked (little red asterisk) as being required. > > If I leave the location blank or if I don’t choose the client, I get a very > nice warning that these fields are mandatory. > > A Contact Report must have a Client. > Please provide a Location. > > > However, if I leave the date field blank (obvious op error) the app crashes. > > > EvaluateExpression failed: <com.webobjects.jdbcadaptor.PostgresqlExpression: > "INSERT INTO contactreport(brieflogoid, iscomplete, distribution, clientid, > jobname, meetingdate, contactreportnotes, personid, nextsteps, location, > jobnumber, id, meetingdecisions, meetingpoints, meetingattendees, lastedited) > VALUES (?::int4, ?::bool, NULL, ?::int4, NULL, NULL, NULL, ?::int4, NULL, > ?::text, NULL, ?::int4, NULL, NULL, NULL, ?::text)" withBindings: > 1:1(briefLogoID), 2:false(isComplete), 3:2(clientID), 4:1(personID), > 5:"xfgfdgn"(location), 6:7(id), 7:"S. Admin"(lastEdited)>: Next exception:SQL > State:23502 -- error code: 0 -- msg: ERROR: null value in column > "meetingdate" violates not-null constraint Detail: Failing row contains (1, > 2, null, null, 7, f, null, null, xfgfdgn, null, null, null, null, null, 1, S. > Admin). > > I checked the model and meetingDate is a Timestamp and does not allow nulls. > I guess I could set up the init method to insert today’s date as a default > and not worry about it but why is D2W blowing up here. > > Is there something special about dates and not null? > > Ted > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/webobjects-dev/prabier%40icloud.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
