Question & Answer
Question
How do you display OrderDate to include Time on the COM UI?
Answer
The reason for OrderDate to be displayed in 'Date' format is because of the data type associated to the control.
We cannot associate the 'Timestamp' format from the UI, it has to be modified through datatypemap.xml
The steps are :
Add a new datatype as timestamp to yfsdatatypemap.xml
Hide out of the box column and add an advanced column.
As it is an advanced column we can set the datatype to timestamp.(the new datatype added in the yfsdataytpemap.xml)
Sample implementation
- Adding a new attribute to yfsdatatypemap.xml
<Attribute DataType="TimeStamp" Name="mydatatype"/> - Code for setting the attribute:
public YRCExtendedTableBindingData getExtendedTableBindingData(String tableName, ArrayList tableColumnNames) {
// Create and return the binding data definition for the table.
System.out.println(tableName);
if(YRCPlatformUI.equals("tblChargesAndRefunds", tableName)){
Iterator itr = tableColumnNames.iterator();
while(itr.hasNext()){
String tblClm = (String)itr.next();
System.out.println("column name == " + tblClm);
exTbd.setTableColumnBindingsMap(getBindingForAdvanceClm());
return exTbd;
}
}
// The default super implementation does nothing.
return super.getExtendedTableBindingData(tableName, tableColumnNames);
}
private HashMap getBindingForAdvanceClm(){
HashMap bindingDataMap = new HashMap();
YRCTblClmBindingData
clmBindingData = new YRCTblClmBindingData();
clmBindingData.setAttributeBinding("@OrderDate");
clmBindingData.setDataType("mydatatype ");
bindingDataMap.put("extn_newClm", clmBindingData);
return bindingDataMap;
}
[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Extensions","Platform":[{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.2;9.1;9.0;1.1;1.0","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]
Historical Number
HTG2349
Was this topic helpful?
Document Information
Modified date:
10 May 2022
UID
swg21561995