Field Personalization on CB20

Sort:
You are not authorized to post a reply.
Author
Messages
Jackie H
Basic Member
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
    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.
      
      	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;
      		}
      	}
      
       
      Vince
      Veteran Member
      Posts: 37
      Veteran Member

        Jackie H
        Basic Member
        Posts: 12
        Basic Member
          Thanks - we will give that a try.
          You are not authorized to post a reply.