Trying to set a field's default with a wrapper program (1.10.1.1)

shaveyh10

New Member
I am trying to write a wrapper program for the 1.10.1.1 (Price List Maintenance) function.

I would like to be able to set the default of the Amount Type (amt_type) and Comb Type (comb_type) fields.

The issue is that these two fields are not DB fields. When I do a ctrl-F on these fields on the screen, I get the field names as listed above in parentheses.

Does anyone know how I could write the wrapper so that on entry of the screen field that it would set the default properly?

My attempt thus far, which results in an "Unknown Field or Variable Name - amt_type" error.

**************************

on entry of amt_type
assign amt_type = "Net Price".
end.

on entry of comb_type
assign comb_type = "Exclusive".
end.

pause 0.

{gprun.i ""pppimt.p""}

**************************
 
pi_amt_type is the field.

Logic used:

find first lngd_det
where lngd_dataset = "pi_mstr"
and lngd_field = "pi_amt_type"
and lngd_lang = global_user_lang
and lngd_key1 = pi_amt_type
no-lock.
amt_type = lngd_translation.
 
So, to be sure that I understand, I would insert your code above my "on entry" section of my wrapper program? Is that correct?

Sorry....it's been a long week... :o
 
Did you get this to work? I've been looking for a way to get defaults for a long time. Please share your experience.
 
If you have need to set defaults for a number of fields you could consider looking at a product such as Tailorpro.
 
Hi,

I know it was late reply but still posting.

Here is the small example through which you can have default value. I have tested this program in CHUI QAD 9.0 SP2 Progress 8.3B.

Regards,
Subhendra.

---------

{mfdeclre.i}

ON ENTRY ANYWHERE DO:
DEF VAR Hdl as handle no-undo.
DEF VAR Cdl as handle no-undo.

Hdl = SELF:HANDLE.

IF Hdl:TYPE = "FRAME" AND Hdl:NAME = "a" THEN
DO:
Hdl = Hdl:FIRST-CHILD.
Hdl = Hdl:FIRST-CHILD.


Blk1:
DO WHILE VALID-HANDLE(Hdl):
IF Hdl:NAME = "ad_name" THEN
Hdl:SCREEN-VALUE = "XYZ".
Hdl = Hdl:NEXT-SIBLING.
END. /* DO WHILE VALID-HANDLE(Hdl) */
END. /* IF Hdl:TYPE = "FRAME" AND Hdl:NAME = "a" */
END. /* ON ENTRY ANYWHERE */


{gprun.i ""adcsmt.p""}

---------------


 
I don't wanna confuse you. Simple program to do this is as follows,

Prg:

{mfdeclre.i}
define variable hdl as handle no-undo.
on go,tab, return anywhere do:
if frame-field = "pi_desc" then do:
hdl = self:handle.
do while (hdl:name <> "amt_type") :
hdl = hdl:next-sibling.
end.
hdl:screen-value = "Net Price". /*Whatever the value u want*/
do while (hdl:name <> "amt_type") :
hdl = hdl:next-sibling.
end.
hdl:screen-value = "Net Price". /*Whatever the value u want*/
do while (hdl:name <> "comb_type") :
hdl = hdl:next-sibling.
end.
hdl:screen-value = "Exclusie". /*Whatever the value u want*/

end.
end.
{gprun.i ""pppimt.p""}

Enjoy.!

Rgds,
R.!
 
Back
Top