Windows Prompter on Grid

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
User avatar
boh
Posts: 6
Joined: Fri Aug 12, 2016 5:11 pm
Location: Italy

Windows Prompter on Grid

Post by boh »

Hi everyone,
I have a field with a prompter; I need to pass to it some information (File key) in order to make a correct selection.
Is there a general way to communicate or to pass information to a prompter?

I know that I can use prompterxxx events on fields, but these events are not present in Grid.

Thank you in advance
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Windows Prompter on Grid

Post by Stewart Marshall »

The simplest technique I think is to add a property to the prompter form and then set the value in the PrompterActivate event

For example, my Prompter Form is called "MyPrompterForm" and I've defined a property as follows. When the value is set, the list is loaded

Code: Select all

Define_Pty Name(Key) Set(SetKey)

Ptyroutine Name(SetKey)
Define_Map For(*Input) Class(#Prim_Alph) Name(#Property)

Clr_List Named(#List)

Select Fields(....
Add_Entry To_List(#List)
Endselect

Endroutine
In the form where it's used, the processing would look like this

Code: Select all

Evtroutine Handling(#Grid.PrompterActivate) Form(#Prompter)

(#Prompter *As #MyPrompterForm).Key := #KeyField

Endroutine
The Form parameter of the event provides access to the instance of the prompter form. We can then cast this to the class required which gives access to the Key property.
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
User avatar
boh
Posts: 6
Joined: Fri Aug 12, 2016 5:11 pm
Location: Italy

Re: Windows Prompter on Grid

Post by boh »

Thank you very much!

It solved our problem

Best regards
Post Reply