Hi,
I'm trying to get variable outputs from two fields and combine the results into one field.
1. If both fields are blank (CHANNEL_NO_P1 and CHANNEL_NO_P2), the concatonated field is blank.
2. If the first field has content but the second field does not, the concatonated should just show the content of the first field (CHANNEL_NO_P1)
3. Else the concatonated field shows the joining of both fields.
I have the part 1 and 3 working but when i add part 2, it screws up the script. (shown below.)
if
(RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1.isNull || RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P2.isNull) {
this.rawValue = "";
}
else if (!(RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1.isNull) || RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P2.isNull} {
RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1;
}
else {
this.rawValue = RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1.rawValue + RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P2.rawValue;
}
I'm sure it's just syntax around the 'not null' part but i can't seem to get it working. Can anyone help?
Cheers
Rob
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Rob,
The second if statement is not assigning the P1 value to "this.rawValue". Also you are missing the .rawValue after the P1 object's reference.
{
this.rawValue = RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHA NNEL_NO_P1.rawValue;
}
I would be inclined to test each objects .rawValue == null or .rawValue != null.
Hope that helps.
Niall
Views
Replies
Total Likes
Hi Rob,
The second if statement is not assigning the P1 value to "this.rawValue". Also you are missing the .rawValue after the P1 object's reference.
{
this.rawValue = RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHA NNEL_NO_P1.rawValue;
}
I would be inclined to test each objects .rawValue == null or .rawValue != null.
Hope that helps.
Niall
Views
Replies
Total Likes
Thank Niall.
I've tidied up the script as below.
if (RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P2.rawValue == null)
{this.rawValue = RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1.rawValue;}
else {this.rawValue = RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P1.rawValue + RadioDuplexer.RadioDuplexerAssetPage1.RadioDuplexerDetailsSubForm.CHANNEL_NO_P2.rawValue;}
And made CHANNEL_P2 field invisible until CHANNEL_P1 is entered.
Thanks again for your help.
Cheers
Rob
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies