Solved

About checkbox

  • 31 October 2022
  • 3 replies
  • 57 views

The workchain consists of several operations. Instead of selecting the workchain from a list, it would be nice if the user selects the different operations with a checkbox in the task. The workchain_id which contains these operations should then be automatically filled based on the selected operations

 

when i want to click checkbox it should take automatically workchain_Id

 

icon

Best answer by Mark Jongeling 31 October 2022, 08:16

View original

This topic has been closed for comments

3 replies

Userlevel 7
Badge +23

Hi naveen,

If I understand your question correctly, you would like [workchain_id] to be automatically assigned an updated value based on the selection of checkboxes?

This could be done with a Default procedure on this Task. Based on which checkboxes are checked, a certain value is given to [workchain_id].

 

can you please give me an example of the default query  

Userlevel 7
Badge +23

Bit hard to determine what that would be as I have no knowledge of which values are suitable for [workchain_id]. Let's say this is a Combo with set values from 0 to 5 (1 for each checkbox)

Example:

select @workchain_id = case
when @kantenbreken = 1 then 0
when @lassen = 1 then 1
when @snijden = 1 then 2
when @vormen = 1 then 3
when @zetten = 1 then 4
when @laskanten = 1 then 5
end

The goal is to supply @workchain_id a valid value based on the other parameters.

If you need to select a record from a table, let's say workchain, to correctly set the worktable_id, you could do something like this. In this example, I assume each checkbox has a corresponding column in the table:

select @workchain_id = w.workchain_id
from workchain w
where w.kantenbreken = @kantenbreken
and w.lassen = @lassen
and w.snijden = @snijden
and w.vormen = @vormen
and w.zetten = @zetten
and w.laskanten = @laskanten