BaBernd
24th October 2016, 08:50
Hello to All,

I'd like to program special field behaviors for two fields in a print session:
1. field: I'd like to select two values for one or two display fields in one step. From the employee session I'd like to select the "initials" and additional the "full name" of an employee. How can I select the second value "full name" parallel to the first value?

2. field: I'd like to integrate a Drop-down Combo Box where I can select more nonconsecutive record sets in one step. If I run the session I'll got the message: x record sets are marked, command not allowed.

I've added a PDF for more clarification.

Best Regards
Bernd

bhushanchanda
24th October 2016, 11:29
Hi,

You can do the following things - >

1. Add a zoom session to initials as standard zoom session
2. in when.field.changes section of initials field or before.field section of full name field, you can write a selection in the program to pick the full name from the table

e.g.

before.full_name.f:
before.field:
select table_name.full_name:full_name.f
from table_name
where table_name._index1 = {:initials}
selectdo
endselect

Also, similarly, once the field initials changes, you need to set your enum values for the category field using set.enum.values.for.field() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_enumerates_set_enum_values_for_field) in when.field.changes:

field.initials:
when.field.changes:
i=0
select table_name.categories
from table_name
where table_name._index1 = {:ref_table_name.field_name}
selectdo
catg(1,i) = table_name.catg
i = i+1
endselect


set.enum.values.for.field("field_name",catg(1,1),catg(1,2)...catg(1,n))

BaBernd
24th October 2016, 18:54
Hello Bhushan,

I've tested your solution for both cases. For the first case I was successful. But for the second case, the drop-down combo box list, I don't exactly understand.

Is the set.enum.values.for.field() function not only for enumerate values (domains)? Cause the table "categories" (tccom901) which I will use is a new table with two columns tccom901.idno as Multibytestring mbs(40) and the associated Description tccom901.desc as Multibytestring mbs(400).

For selecting the different values I make a zoom_to("tccom0901m000") in the Zoom-Register with return value for tccom901.idno. When I select more than one value I got the mentioned message like "x values selected. Only one is allowed".

Best Regards
Bernd

bhushanchanda
25th October 2016, 11:28
Hi,

If those are multibyte strings and you still have to build the session with those selections as enum's you should go ahead with the dialog.* commands.

In that case, you will be able to build the list box using dialog.add.listbox() dynamically. AFAIK, DFE might not work in that case also set.enum.values.for.field() will only work with domains. Won't be a straightforward approach but seems doable with workarounds.

BaBernd
25th October 2016, 11:51
Hi Bhushan,

Thanks for that hint. But I have to beg your pardon! I mixed some facts.
What I need is the possibility to select non consecutive values from a zoom to session into the print session. It has nothing to do with a drop down combo box. Sorry for that.
Maybe I should delete this thread not to puzzle other people, and open a new one?

Meanwhile I found an example in session sales order (tdsls4100m000). Here is a reports "print sales order Acknowledgements/RMAs" (tdsls4401m000) with a button "Specific Orders" (tdsls4820s000) which I can adopt to my problem. It is only a workaround, cause the selection is limited to 10 selections but that will be enough also for my problem.

Thanks a lot for help. Your hint with using dialog.add.listbox() dynamically would be the correct or elegant way but that's to big for me ;-)

Best Regards
Bernd

bhushanchanda
25th October 2016, 12:50
Correct. You can also take a look at Select Invoices for Payments(tfcmg1220m000) and many others where they are using a temporary table to do the job. No need to delete the thread, probably someone might come up with a requirement like this one.