0

I have two windows w_customerorder and w_customerfree and the cusromerorder window has orderid which is identity column.now i want to pass this orderid to the customerfree window which has orderid column while its opening.can any one help me with this?

Remi
  • 17
  • 1
  • 9
  • 2
    Welcome to stack overflow :-) Please look at [ask] and how to create a [mcve]. This will help to get useful answers. I flagged this question for closing. – JimHawkins Jul 19 '16 at 06:30

1 Answers1

0

Do you open w_customerfree from w_customerorder?

Then you can use openwithparm(w_customerfree, ll_orderid) and in the w_customerfree window you write ll_orderid = Message.longparm in the open() event.

Even if you don´t open w_customerfree from w_customerorder you can use the Message.longparm variable. Then you just fill it manually in w_customerorder

Message.longparm = ll_orderid
Seki
  • 11,135
  • 7
  • 46
  • 70
Michael
  • 499
  • 4
  • 16
  • should i declare the ll_orderid in instance or global? – Remi Jul 19 '16 at 09:31
  • my guess is you can leave it as a local variable, because you store the orderid in the message object. Instance Variables are for one entire window and global variables are for the entire application. But could you be a little more clear on what exactly you are trying to do, because I am still a little struggling as of now. (see the question in my answer) – Michael Jul 19 '16 at 11:17
  • i need to open w_customerfree from w_customerorder.both these windows have the column orderid. now i need to pass the orderid from w_customerorder to w_customerfree? – Remi Jul 19 '16 at 11:52
  • Okay, then you can do it like I said. Whereever you open the window you do the following long ll_orderid ll_orderid = openwithparm(w_customerfree, ll_orderid) Then in w_customerfree in the open event you should get the orderid with long ll_orderid ll_orderid = Message.longparm – Michael Jul 20 '16 at 07:02
  • setting manually the `message` object is code smell. It can be easily broken by modifying the object hierarchy as the `message` object must be accessed at the very beginning of object open because it can be modified implicitly by following code. If the way to open the window cannot be changed by a `openwithparm()`, the parameter can be passed with a setter of the window before the open (instantiate it then open it) – Seki Aug 05 '16 at 23:14