You can add a text
field in any screen,
and validate that the text
field does not contain
special characters. For example, if you enter abc@
,
the custom validation method is called and an appropriate error message
is displayed.
Before you begin
Understand how to add widgets to a screen.
Procedure
-
Log on to Sterling™ Call Center. The Home
page opens.
- open the Create Consumer screen in any of the following
ways:
- On the Home page, in the Customer panel
click Create Consumer.
- From Related Tasks, click Create
Consumer.
- From the application header, click
the Development Tools icon
, and select Customize from
the list. Hover over the Contact Information screen
and right-click to select the screen. Alternatively,
you can select
Customize from Outline from
the application header. The
Select Screen to Extend window
opens. From the tree, select
CreateContact and
click
Extend Screen.
Note:
- If you cannot customize the selected screen, an appropriate message
is displayed.
- If multiple instances of the same screen are found, by default,
the first instance of the screen is selected for customization.
- By default, the Layout tab is selected. From the Widget
Palette panel, select and drag the Textbox widget
to the Screen Outline panel and place the widget
in the appropriate position. The Basic Properties window
opens.
- In the Unique identifier field,
select the
extn_company_textfield
.
- In Field label, click
. The Field label window
opens.
- Click
. The Add
Bundle Entry window opens.
- In the Bundle Text field, enter Company
name.
- In the Bundle key field, extn_company_name bundle
key is populated.
- Click Ok.
- Click Select with Colon. The Basic
Properties window opens.
- Click Apply.
- Click the Binding tab and expand Source.
- In the Namespace field, select getCustomerContact_output from
the list.
-
In the Path field, enter
Customer.CustomerContactList.CustomerContact.Company.
- Expand Target, and in the Namespace field,
select manageCustomer_input from the list.
-
In the Path field, enter
Customer.BuyerOrganization.CompanyName.
- Click the Events tab.
- Add the local onBlur event by clicking
the Add icon
. The Subscriber
Details window opens.
- In the Method field, enter validateInput.
- Click Ok.
- Click the Others tab. Do the following
steps:
- From the Available Properties list,
select Max length and click Add.
- In the Max length field, enter
the maximum number of characters that are allowed for the
Company
name
field. For example, if you enter 10, the
total number of characters that are allowed to be entered in the Company
name
field is restricted to 10 characters.
- Click Apply.
- Click Save. The createContactExtn.js file
is generated.
- Click Close.
What to do next
- Browse to <INSTALL_DIR>/extensions/isccs/webpages/customer/create,
and open the createContactExtn.js file.
- Add the following custom code to perform custom validation:
validateInput : function(UIEvent,bEvent,control,args){
var inputModel = _scScreenUtils.getTargetModel(
this, "manageCustomer_input", null);
var value = dLang.getObject("Customer.BuyerOrganization.CompanyName", false, inputModel);
//dLang refers to Dojo class
var index= value.indexOf("@");
if(index!== -1){
_scWidgetUtils.markFieldinError(this,"extn_company_name","Input contains invalid characters",true);
return;
}
}
- Import the appropriate utilities in
scDefine
.
- Refresh or reload the screen to view the changes.