zechasso
3rd August 2012, 08:52
I want to save the position-number of a sales order position in a PCF-attribute.
Is it possible to get this information for example with a 4GL-command?
EdHubbard
3rd August 2012, 09:36
Just some standard sql should do it (with a "!" before each line as you are in constraint on Baan4):
[ordline] = your name for the feature you are storing position number in
!table ttipcf500
!table ttdsls041
!import("tipcf500.cpva", tipcf500.cpva)
!select tdsls041.*
!from tdsls041
!where tdsls041._index5 = {:tipcf500.cpva}
!as set with 1 rows
!selectdo
! [ordline] = tdsls041.pono
!endselect
Code not tested!
Ed
zechasso
3rd August 2012, 11:03
Thank you for the quick answer.
I tried this way before, but when creating a new sales order position there is no entry in the tdsls041 before saving the position. So it's not possible to get the value this way.
I tried the following way too:
!get.var(parent,"tdsls041.hpon.sc",<VAR>)
But it didn't work too.
I need to get the values from the field of the session tdsls4102s000.
Is there any way to get values directly from session-fields?
EdHubbard
3rd August 2012, 13:04
Is the issue that your parent process is not what you think it is?
http://www.baanboard.com/baanboard/showthread.php?t=12608&highlight=get.var
zechasso
6th August 2012, 14:45
I tried this way but with the function get.pgrp(pid) I get the PID from my own PCF-process, not from the parent.
Can you tell how I can get the parent-PID?
EdHubbard
7th August 2012, 10:13
This isn't something I have used so can't really help.
Do you need to go up the chain of PIDs - that is, get the PID of tipcf5120 and then from that get the PID of tdsls4102?
You can get the actual runtime values using ottstpshell.
Perhaps if you play around inside your constraint code you can display various values to the screen in a message box until you get the right code that works?
günther
8th August 2012, 08:16
...with the function get.pgrp(pid) I get the PID from my own PCF-process...
No. You get the identification number of the process group. That can be identical to the process id, but don't rely on that! See set.pgrp() for details, or have look at Option Dialog / Start shell / ps / columns 1 and 2.
I think you can use the predefined variable 'parent'.
Regards Günther
Tomas Toth
10th April 2014, 11:19
The position is already in table tipcf500.
So you can only import field tipcf500.refp into the configurator...