veyant
8th May 2006, 14:20
Hi,

I am working on AFS for session tdpur4000s000. It has 2 fields on the form

Ordered.quantity and delivery.date

delivery.date is a tcdate domain with 2 segments - one for date and one for time.

can anybody help me how to put values thru stpapi for the date variable.

I have utc value in one variable and tring to pass values as follows, but on stpapi.update, it thros a error "USE of NULL pointer"...

Pls help in correcting.. given below is the code..

yyyy = 2006
mm = 05
dd = 16
del.date = date.to.utc(yyyy,mm,dd,00,00,00)

stpapi.put.field("tdpur4000s000","ordered.quantity","2")
stpapi.put.field("tdpur4000s000","delivery.date.segment.1",str$(del.date))
stpapi.put.field("tdpur4000s000","delivery.date.segment.2","2359")
stpapi.update("tdsls4000s000",1,api.error)

as it goes to stpapi.update, i get error "use of Null pointer on "" and it terminates the session tdpur4000s000.

can somebody help me how to pass date in segments.

RieseUSA
9th May 2006, 02:35
Veyant:

Have you just tried setting the 'del.date' to date/time without segments? I do not think that tcdate is a segmented domain like tcitem for example. If delivery date has domain tcdate, then it should be UTC, which has date/time in one value (number of seconds since 1/1/1970 0:00:00).

yyyy = 2006
mm = 05
dd = 16
del.date = date.to.utc(yyyy,mm,dd,23,59,59)

stpapi.put.field("tdpur4000s000","ordered.quantity","2")
stpapi.put.field("tdpur4000s000","delivery.date",str$(del.date))
stpapi.update("tdsls4000s000",1,api.error)

Yours,
Stephan

veyant
9th May 2006, 08:55
Hi,

Yes it is a UTC format. I tried same what u suggested but it gives a error on update

"Use of a NULL pointer ' '

and terminates.

Can anybody help me in understanding.. which variable's value is goin as NULL however in session tdpur4000s000 only 2 Input variables r there so there is no other variables.

tha