Issues with multiple checkboxes

Hi All,

I am facing Issue With More than two selection of Checkboxes.
I am attaching the requirement document.
Thanks

More than two selection Checkbox.doc

OriginalPostID-221397

OriginalPostID-221397

  Discussion posts and replies are publicly visible

Parents
  • Ramesh, I see a solution has already been provided/discussed but here's one I played around with earlier this morning. 

    Here's an image and code attachment you can test out. 

    The idea here is to have a row for each exchange that has its own set of classes that will be indexed into based on the index position that comes back from using wherecontains() against a constant of exchanges. Afterwards, remove duplicates and use the unique set for your checkbox. 

    Note: If any of the classes were to ever contain a comma in their name, then obviously, the code would not work.

    Picture

    Code 

    load(
      /*ri!exchanges = values that would come from your checkboxField*/
      
      /*If you stored your exchanges in a constant*/
      local!exchangeConstant:{"CMEEL", "CMECE", "CBOT", "OTHER"},
      
      /*Pull the index position of your exchange choices*/
      local!exchangeIndexes:wherecontains(ri!exchanges, local!exchangeConstant),
      
      /*What classes each exchange currently have*/
      local!classes:
      {
        "Agricultural, Energy, Foreign Exchange",  /* CMEEL */
        "Agricultural, Energy, Foreign Exchange",  /* CMECE */
        "Agricultural, Energy, Foreign Exchange",  /* CBOT */
        "Agricultural, Equity, Interest Rates"     /* OTHER */
      }, 
    
      /*Pulls which rows of classes to retrieve based on Exchange Indexes*/
      local!classIndexes:apply(
        index(local!classes, _, {}), 
        {local!exchangeIndexes}
        ), 
      
      /*Splits result from local!classIndexes into multiple text values (for checkbox purposes) */  
      local!splitIndexes:split(local!classIndexes, ","), 
      
      /*Removes duplicates*/
      local!removedDuplicates:union(local!splitIndexes, local!splitIndexes), 
      
      local!removedDuplicates
        
    )

Reply
  • Ramesh, I see a solution has already been provided/discussed but here's one I played around with earlier this morning. 

    Here's an image and code attachment you can test out. 

    The idea here is to have a row for each exchange that has its own set of classes that will be indexed into based on the index position that comes back from using wherecontains() against a constant of exchanges. Afterwards, remove duplicates and use the unique set for your checkbox. 

    Note: If any of the classes were to ever contain a comma in their name, then obviously, the code would not work.

    Picture

    Code 

    load(
      /*ri!exchanges = values that would come from your checkboxField*/
      
      /*If you stored your exchanges in a constant*/
      local!exchangeConstant:{"CMEEL", "CMECE", "CBOT", "OTHER"},
      
      /*Pull the index position of your exchange choices*/
      local!exchangeIndexes:wherecontains(ri!exchanges, local!exchangeConstant),
      
      /*What classes each exchange currently have*/
      local!classes:
      {
        "Agricultural, Energy, Foreign Exchange",  /* CMEEL */
        "Agricultural, Energy, Foreign Exchange",  /* CMECE */
        "Agricultural, Energy, Foreign Exchange",  /* CBOT */
        "Agricultural, Equity, Interest Rates"     /* OTHER */
      }, 
    
      /*Pulls which rows of classes to retrieve based on Exchange Indexes*/
      local!classIndexes:apply(
        index(local!classes, _, {}), 
        {local!exchangeIndexes}
        ), 
      
      /*Splits result from local!classIndexes into multiple text values (for checkbox purposes) */  
      local!splitIndexes:split(local!classIndexes, ","), 
      
      /*Removes duplicates*/
      local!removedDuplicates:union(local!splitIndexes, local!splitIndexes), 
      
      local!removedDuplicates
        
    )

Children
No Data