RCP: How to update the "Sold To Address" to some other address say "Office Address" of customer search screen by using the RCP implementation?

Technote (troubleshooting)


Problem(Abstract)

How to update the "Sold To Address" to some other address say "Office Address" of customer search screen by using the RCP implementation?

Resolving the problem

To update the "Sold To Address" to some other address say "Office Address" of customer search screen following piece of code in the class extended by the YRCExtentionBehavior could be helpful to achieve this requirement.

-------------------------------------------------------------------------------------------------------------------------------------------------
public void postSetModel(String namespace) {
// TODO Auto-generated method stub
if("address".equals(namespace)){
Label lblAddress = (Label)getLblAddress(getOwnerForm());
if(lblAddress != null){
System.out.println(lblAddress.getText());
if("Sold To Address".equals(lblAddress.getText())){
lblAddress.setText("Office Address" );
}
}
}
//elsepostSetModel(namespace);
}

private Control getLblAddress(Composite composite) {
Control[] children = composite.getChildren();
Control child = null;
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof Composite) {
return getLblAddress((Composite) children[i]);
} else {
child = children[i];
String name = (String) child.getData(YRCConstants.YRC_CONTROL_NAME);
//System.out.println("Name of control =" + name);
if("lblAddress".equals(name) && child instanceof Label){
return child;
}
}
}

return null;
}
---------------------------------------------------------------------------------------------------------------------------------------------------------
Following are the steps which user has to try to achieve this requirement with using the above code:

Create a Normal Extension Behavior (YRCExtensionBehavior) on the Sold To Address label, for the extension behavior define a class in the Extn Behavior tab under the Synchronize present in the RCP tool.

The elements present in the ExtnBehavior tab are FormId, Behavior, ClassName and following would be the entries with the values corresponding to these elements after the modifications:

FormId- com.yantra.ycd.rcp.tasks.common.screens.panels.YCDAddressPanel

Behavior- ExtnBehavior

ClassName- class extended by the YRCExtentionBehavior

Add the above mentioned code in the class extended by the YRCExtentionBehavior, after modifying the class launch the SOM and check the customer search screen, Sold TO Address would be updated to the required one.


Cross reference information
Segment Product Component Platform Version Edition
Commerce Sterling Selling and Fulfillment Suite Sterling Call Center and Store Windows 9.2 All Editions

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Sterling Selling and Fulfillment Suite
Sterling Call Center and Store

Software version:

9.2

Operating system(s):

Windows

Software edition:

All Editions

Reference #:

1632078

Modified date:

2013-03-29

Translate my page

Machine Translation

Content navigation