BaaNovva
21st August 2007, 08:24
Hi all,

I'm having trouble populating Warehouse Order lines.
I have attached a screen shot of debugged code.
The problem seem to be trivial since this is my first
try with synchronized dialog session.

The problem happens when an insert is given from
whinh2510m000 to bring up the subsession
whinh2110s000.

At the time of 'insert' (line# 90), the line is not
executed and I get an errmsg="Item ".
The required field buffer are put before 'insert' but
execution of 'insert' does not take place.

Appreciate if anyone can let me know the solution.

Thanks!

en@frrom
21st August 2007, 10:10
I assume it has to do with the fact that item is a segemented field. It looks like you use a system generated dll (via ttstpcreatdll), did you check whether the system generated dll has both the item.segment.1 and item.segment.2 functions, and are you putting the correct values for both segments (-> pos. 1->9 = project, pos. 10->47 = item)?

BaaNovva
21st August 2007, 10:29
Hi...

Thanx for replying.

Yes, the wrapper is system generated but did not generate
segmented item. The subsession has the project segment
of the Item disabled. The following is the generated code:


function extern void whinh2110s000f.put.Item(domain tcitem value)
{
stpapi.put.field("whinh2110s000", "whinh210.item", value)
}

function extern domain tcitem whinh2110s000f.get.Item( )
{
domain tcitem _value
stpapi.get.field( "whinh2110s000", "whinh210.item", _value)
return(_value)
}


I also removed the leading 9 spaces and tried to put only
the Item code but its the same result.

Please let me know in what way Item can be populated.
Otherwise, I hope the sequence of execution is alright.

Waiting for your reply...

Thanks!...

mark_h
21st August 2007, 14:45
Is this Baan IV or V? It sounds like V and I agree with what Eli was suggesting. So try something like this:

#define WH.SHORT "whinh2202m000"
stpapi.put.field(WH.SHORT, "item.segment.1", " ")
stpapi.put.field(WH.SHORT, "item.segment.2", item)

I pulled this from another post - you can search on item.segment see other examples.

BaaNovva
22nd August 2007, 05:02
Yes. This is BaanV.
And thanks a lot to you guys.

The generated code I quoted earlier
must be modified as follows :


function extern void whinh2110s000f.put.Item(domain tcitem value)
{
stpapi.put.field("whinh2110s000", "whinh210.item.segment.2", value)
}

function extern domain tcitem whinh2110s000f.get.Item( )
{
domain tcitem _value
stpapi.get.field( "whinh2110s000", "whinh210.item.segment.2", _value)
return(_value)
}


The ".segment.#" must be part of the field name for proper
assignment of Item as it is segmented in BaanV.

Thank u Guru and Mark once again!