Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Launch function value passing

20 views
Skip to first unread message

al561914

unread,
Dec 16, 2009, 3:34:27 PM12/16/09
to
Hello!

Beforehand, any help is greatly appreciated. I don't know the reason
but our client uses a customized Sales Order Scheduling screen to
enter some data on User fields and based on them calculate the total
quantity for the line. The problem they have is they really don't use
any of the scheduling features, it is only used to perform the
calculations of the line quantity but this customization throws some
errors when the users move through the grid and because of the way the
screen works, quantities can't be updated once entered. We've been
asked to replace this screen with a custom one and provide this
functionality.

If we replace the Schedule button on Sales Orders screen with a custom
one and launch the custom Schedule screen the problem is how to update
the quantity in the line of the order after the user closes the custom
schedule screen. Is there a way to pass a value back to the the VBA
code from the launched VB Tools screen?

Thanks again!
Miguel

Barry Flynn

unread,
Dec 17, 2009, 2:25:10 AM12/17/09
to
Miguel

> Is there a way to pass a value back to the the VBA
> code from the launched VB Tools screen?

A VBTools screen can return parameters as part of the ScreenExit statement.
(There will be one in Form_Unload which is executed on a "normal close".
You may have others - for example if you have a button which is pressed to
"select an item" and close the screen.)

For example
Call screenexit(APPLICRETURNPARMS, gsReturnParm1 & PRMSEP &
gsReturnParm2)

In the customization (or VBTools) code which called that "launched program",
you use ApplGetReturnParms to retrieve the parms.

In customization, my vague memory is that at one time that call was not
available.
However, at a quick glance, it looks like it was available in 4.5.
(I didn't check any earlier versions.)

So assuming you are on 4.5 or later, you should be able to do it that way.

Barry
--

Barry Flynn
Complete Solutions DG


"al561914" <al56...@gmail.com> wrote in message
news:c457cc81-b48e-4d31...@v7g2000vbd.googlegroups.com...

al561914

unread,
Dec 17, 2009, 3:27:24 PM12/17/09
to
On Dec 17, 1:25 am, "Barry Flynn" <Anonymouse> wrote:
> Miguel
>
> > Is there a way to pass a value back to the the VBA
> > code from the launched VB Tools screen?
>
> A VBTools screen can return parameters as part of the ScreenExit statement.
> (There will be one in Form_Unload which is executed on a "normal close".
> You may have others - for example if you have a button which is pressed to
> "select an item" and close the screen.)
>
> For example
>       Call screenexit(APPLICRETURNPARMS, gsReturnParm1 & PRMSEP &
> gsReturnParm2)
>
> In the customization (or VBTools) code which called that "launched program",
> you use ApplGetReturnParms to retrieve the parms.
>
> In customization, my vague memory is that at one time that call was not
> available.
> However, at a quick glance, it looks like it was available in 4.5.
> (I didn't check any earlier versions.)
>
> So assuming you are on 4.5 or later, you should be able to do it that way.
>
> Barry
> --
>
> Barry Flynn
> Complete Solutions DG
>
> "al561914" <al561...@gmail.com> wrote in message

>
> news:c457cc81-b48e-4d31...@v7g2000vbd.googlegroups.com...
>
> > Hello!
>
> > Beforehand, any help is greatly appreciated. I don't know the reason
> > but our client uses a customized Sales Order Scheduling screen to
> > enter some data on User fields and based on them calculate the total
> > quantity for the line. The problem they have is they really don't use
> > any of the scheduling features, it is only used to perform the
> > calculations of the line quantity but this customization throws some
> > errors when the users move through the grid and because of the way the
> > screen works, quantities can't be updated once entered. We've been
> > asked to replace this screen with a custom one and provide this
> > functionality.
>
> > If we replace the Schedule button on Sales Orders screen with a custom
> > one and launch the custom Schedule screen the problem is how to update
> > the quantity in the line of the order after the user closes the custom
> > schedule screen. Is there a way to pass a value back to the the VBA
> > code from the launched VB Tools screen?
>
> > Thanks again!
> > Miguel

Thanks a lot Barry!!! I'll check that out, it seems it might work,

Miguel

rga...@gmprocesos.com.mx

unread,
Mar 23, 2016, 1:02:09 AM3/23/16
to
Thank you Barry, after 6 years your solution still works

Regards,
0 new messages