Show answerHide answer
Correct answer: C ((phoneOwner.PhoneFields.NationalSubscriberNumber[3..5] as String).equals('555')) ? DisplayKey.get("BadPhoneNumber") : null
Explanation
Answer Option (Which option is correct) C. ((phoneOwner.PhoneFields.NationalSubscriberNumber[3..5] as String).equals('555')) ? DisplayKey.get("BadPhoneNumber") : nullExplanation:
Digits four through six correspond to zero-based positions three through five. The expression must test that precise substring rather than search the entire phone number. The source-selected expression returns a display-key error message on failure and null when the value passes the check.
Verification note: The exact option selection could not be independently verified from accessible official documentation. Relevant official topic links are provided, but some exact configuration or training rules require the product Configuration Guide or Cloud Standards behind sign-in. The source key is retained.
Why the other options are incorrect:
A. ((phoneOwner.PhoneFields.NationalSubscriberNumber[4..6] as String) == '555') ? DisplayKey.get("BadPhoneNumber") : true:
The range starts at index four instead of three. That shifts the checked substring by one digit. It also returns true instead of the source-selected successful null.
B. ((phoneOwner.PhoneFields.NationalSubscriberNumber as String).contains('555')) ? DisplayKey.get("BadPhoneNumber") : null:
contains searches the entire subscriber number. It can reject 555 outside the prohibited prefix. The requirement is limited to digits four through six.
D. (phoneOwner.PhoneFields.NationalSubscriberNumber[3..5].equals('555')) ? DisplayKey.get("BadPhoneNumber") : true:
The positions target the requested prefix. The success branch differs from the selected validation contract. That return value must match what the widget expects.
References:
Guidewire-authored PolicyCenter 10.1.2 - Rules and validation signatures
Gosu language project - Operators, loops, functions, and properties