Field Personalization on CB20

 3 Replies
 0 Subscribed to this topic
 11 Subscribed to this forum
Sort:
Author
Messages
Jackie H
Basic Member Send Private Message
Posts: 12
Basic Member
We've been having issues with spaces being entered either at the beginning or the end of the CBT-TRANS-NBR when manually input.  The field size is up to 10 alpha characters. We've requested users enter 10 characters to eliminate this issue, but they get creative and the addition of spaces causes an issue with locating the transaction later.  Is there a way to personalize the field on the form to require exactly 10 characters be entered?
Vince
Veteran Member Send Private Message
Posts: 37
Veteran Member
What you need to accomplish this is to attach some script to the form.
Below is JScript for Smart Office. Portal/Design Studio would also support this, but with different script.
[code] public function OnBeforeTransaction(sender: Object, e: CancelTransactionEventArgs) { if (e.FunctionCode != "A" && e.FunctionCode != "C") return; var transFld = "CBT-TRANS-NBR" var transNbr = form.GetElementValue(transFld); if (String.IsNullOrEmpty(transNbr) || transNbr.Length < 10 || transNbr.Contains(" ")) { ConfirmDialog.ShowAttentionDialog("Bank Transaction Entry", // import Mango.UI "Please enter 10 non-blank characters for Transaction Number", null) var textBox: TextBox = form.GetElement(transFld); textBox.Focus(); e.Cancel = true; } } [/code]
Vince
Veteran Member Send Private Message
Posts: 37
Veteran Member

Jackie H
Basic Member Send Private Message
Posts: 12
Basic Member
Thanks - we will give that a try.