This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



May 8, 2012, 3:17 PM
18 Posts
topic has been resolvedResolved

Switch Case Statement in Label & Computed text

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 2
Hi
 
I'm having trouble with this serverside switch statement
 
var form = @GetField("form");

switch(form)
{
case 'fm_Company':
  return "Company Profile";
  break;
case 'fm_Contact':
 return "Contact Profile";
  break;
default:
  return "";
}
 
It just displays the default even though I know that '@GetField("form") returns a value. Any ideas on how to troubleshoot this?
 
Many thanks
 
Matt
May 8, 2012, 7:56 PM
17 Posts
Re: Switch Case Statement in Label & Computed text
Hi Matt,
 
I tried the same: @GetField returns an array (I assume it is standard behavior, but the documentation does not describe the return type in detail) so the first line should read:
var form = @GetField("form")[0];
 
This is what works for me.
 
Regards,
Patrik
May 9, 2012, 7:26 AM
18 Posts
Re: Switch Case Statement in Label & Computed text
Many thanks Patrik, that worked for me too.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal