create new timecard issue

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
administrator1
User
Posts: 49
Joined: Wed Dec 31, 1969 8:00 pm

create new timecard issue

Post by administrator1 » Wed Apr 29, 2009 12:07 pm

I am trying to create a timecard by using the following code:
dtoTimecard = New timeCardDto()
dtoTimecard.dateAdded = Now
dtoTimecard.dateEnd = TimeZoneInfo.ConvertTime(Convert.ToDateTime('5/2/9 10:00 PM"), TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"), TimeZoneInfo.Local)
dtoTimecard.dateBegin = DateAdd(DateInterval.Day, -6, dtoTimecard.dateEnd)
dtoTimecard.placementID = 1493
dtoTimecard.status = "Draft"
saveResult = BHService.save(BHSession, dtoTimecard)
BHSession = saveResult.session
dtoTimecard = CType(saveResult.dto, timeCardDto)
hTimecardID.Value = Convert.ToString(dtoTimecard.timeCardID)

getting the following exception:
org.hibernate.PropertyValueException: not-null property references a null or transient value: com.bullhorn.entity.timecard.TimeCard.dateBegin

I checked and the value of the dateBegin is set to '4/26/9 10:00 PM'

what am i doing wrong?

administrator1
User
Posts: 49
Joined: Wed Dec 31, 1969 8:00 pm

Re: create new timecard issue

Post by administrator1 » Wed Apr 29, 2009 12:41 pm

Never mind i solved it.

We must set corresponding "Specified" field to True

otherwise it thinks it's null

jp.dowd
User
Posts: 164
Joined: Wed Dec 31, 1969 8:00 pm

Re: create new timecard issue

Post by jp.dowd » Wed Apr 29, 2009 12:48 pm

Glad you got it, if you notice anything else please let us know.

J.P.

Post Reply