Skip to main content
Solved

About checkbox


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

 

Best answer by Mark Jongeling

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  

 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

3 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+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].

 


  • Author
  • Rookie
  • 1 reply
  • October 31, 2022

can you please give me an example of the default query  


Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • 3936 replies
  • Answer
  • October 31, 2022

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  

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings