Hi Team,
Requirement is , Display new field "Bundle Version" based on Component value "NetSuite"> I tried to accomplish this through behaviors plugin. When selected the "NetSuite" component, the bundle Version is not displaying on create screen. Did i miss anything in this script ? can anyone please help on this.
Below is the code i used.
def formComponent = getFieldByName("Component/s")
def formBundle = getFieldByName("Bundle Version")
def componentFieldValues = formComponent.getValue() as String
if (componentFieldValues.toString().contains("NetSuite"))
{
formBundle.setHidden(false)
formBundle.setRequired(true)
}
else
{
formBundle.setHidden(true)
formBundle.setRequired(false)
}
Where did you put your behaviour? If it is in the screen Initializer, then it only executes the first time that the screen is shown. If you put it into the Component/s field, it will run each time Component/s is accessed.
Thanks for the quick reply @C_ Derek Fields , I have added "Bundle Version" field and added the script to server side script
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to put this script on the Component/s field. You want the behavior to trigger when the component/s field is updated. That will then update the bundle version field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @C_ Derek Fields ,
Its not displayed. Is the code correct ? Please attached screenshot for your reference.
def formComponent = getFieldByName("Component/s")
def formBundle = getFieldByName("Bundle Version")
def componentFieldValues = formComponent.getValue() as String
if (componentFieldValues.toString().contains("NetSuite"))
{
formBundle.setHidden(false)
formBundle.setRequired(true)
}
else
{
formBundle.setHidden(true)
formBundle.setRequired(false)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The script isn't correct. This should work for you:
def formComponent = getFieldById(getFieldChanged())
def formBundle = getFieldByName("Bundle Version")
List componentFieldValues = formComponent.getValue().collect {it.getName()}
if ("NetSuite" in componentFieldValues)
{
formBundle.setHidden(false)
formBundle.setRequired(true)
}
else
{
formBundle.setHidden(true)
formBundle.setRequired(false)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @C_ Derek Fields ,
Perfect. Its working as expected. Thank you so much for your quick response Derek. For this line its showing error like "Cann't find matching method etc", but we can ignore that error.
List componentFieldValues = formComponent.getValue().collect {it.getName()}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.