Page 1 of 1

Paste a form into the stock screen

Posted: Tue Sep 05, 2006 5:39 pm
by Joseph
Hi,

Anyone have a script that will let me look-up the contents of the Capital folder and let me choose a form? I have a set-up a form that gets printed with each invoice I save for every kit on that invoice that has a form linked to it. I put the form name in a stock user field. Rather than remember the form names I want to be able to press a button and select the form from a list.

Thanks.

Posted: Tue Sep 05, 2006 5:48 pm
by COBS Tech Support
Create a field object and ensure that the parameter 'Look-up Button' is ticked and inside the Formula tab paste the following script. This script also removes the '.STY' extension from the selected file name for neatness.

***

If ButtonPress
Declare cForm Type Character
cForm := InputFile('STY', TRUE, PathProgram())

If "\" $ cForm
cForm := Substr(cForm, RAT("\", cForm) + 1)
Endif

If "." $ cForm
cForm := Left(cForm, AT(".", cForm) - 1)
Endif

SCRWrite("KITFORM", cForm)
Endif