How to get opportunities section emojis faces on contact section page
If you observe on opportunities section some emojis faces is there. how to get that emojis on contact section page.
I need manager mood emoji faces on contact section.I was tried this on coding level but i was failed to crack that.
define("ContactPageV2", [],
function() {
return {
entitySchemaName: "Contact",
attributes: {
"UsrMood": {
lookupListConfig: {
orders: [{columnPath: "Position"}]
}
},
mixins: {
CompletenessMixin: "Terrasoft.CompletenessMixin",
TooltipUtilitiesMixin: "Terrasoft.TooltipUtilities"
},
},
modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
methods: {
getLookupQuery: function(filter, columnName) {
var esq = this.callParent(arguments);
if (columnName === "UsrMood") {
esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_IMAGE_COLUMN, "primaryImageValue");
}
return esq;
},
isLabelMetricsContainerVisible: function() {
return this.get("DaysAtStageVisible");
},
/**
* @private
* @deprecated
*/
isMetricsContainerVisible: function() {
return this.getIsFeatureEnabled("OpportunityMetrics");
},
},
dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"parentName": "ProfileContainer",
"propertyName": "items",
"name": "MetricsContainer",
"values": {
"layout": {"column": 1, "row": 0,"rowSpan": 1, "colSpan": 24},
"itemType": Terrasoft.ViewItemType.CONTAINER,
"classes": {"wrapClassName": ["ts-metrics-container"]},
"items": [],
"visible": {"bindTo": "isMetricsContainerVisible"}
}
},
{
"operation": "merge",
"name": "PhotoTimeZoneContainer",
"values": {
"layout": {
"colSpan": 24,
"rowSpan": 1,
"column": 0,
"row": 1
}
}
},
{
"operation": "insert",
"parentName": "MetricsContainer",
"propertyName": "items",
"name": "MoodContainer",
"values": {
"items": [],
"itemType": this.Terrasoft.ViewItemType.CONTAINER,
"classes": {"wrapClassName": ["ts-metric-item", "ts-mood-container"]}
}
},
{
"operation": "insert",
"parentName": "MoodContainer",
"propertyName": "items",
"name": "OpportunityMood",
"values": {
"generator": "ImageListGenerator.generateImageList",
"bindTo": "Mood",
"id": "MoodImageList",
"schemaName": "ContactMood",
"schemaColumn": "Image",
"caption": {"bindTo": "Resources.Strings.MoodListCaption"},
"controlConfig": {
"wrapClasses": ["opportunity-mood-image-list image-list"],
"modalBoxClasses": ["opportunity-mood-image-list"]
},
"markerValue": "OpportunityMood",
"tips": []
},
"alias": {
"name": "Mood",
"excludeProperties": ["layout"],
"excludeOperations": ["remove", "move"]
}
},
{
"operation": "insert",
"parentName": "OpportunityMood",
"propertyName": "tips",
"name": "MoodTip",
"values": {
"content": {"bindTo": "Resources.Strings.MoodTip"}
}
},
{
"operation": "insert",
"parentName": "MoodContainer",
"propertyName": "items",
"name": "MoodCaption",
"values": {
"itemType": Terrasoft.ViewItemType.LABEL,
"caption": {"bindTo": "Resources.Strings.MoodCaption"},
"classes": {"labelClass": ["ts-metric-item-caption"]}
}
}
]/**SCHEMA_DIFF*/
};
});
For this code i got some changes in contact page but it was not having clicking option to select emojis
Kindly help us resolve this as early as possible.
Thanks in advance
Like
Hello praveen,
I have checked your code and found some issues. At first make sure that you have object called "ContactMood" that you are using. Also, check that contact has field called "UsrMood". In addition, you should change bindings for OpportunityMood and MoodTip.
I repaired it, so you can simply use the code below:
define("ContactPageV2", ["css!OpportunityCommonCSS"], function() { return { entitySchemaName: "Contact", attributes: { "UsrMood": { lookupListConfig: { orders: [{columnPath: "Position"}] } }, mixins: { }, }, modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/, details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/, methods: { getLookupQuery: function(filter, columnName) { var esq = this.callParent(arguments); if (columnName === "UsrMood") { esq.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_IMAGE_COLUMN, "primaryImageValue"); } return esq; }, isLabelMetricsContainerVisible: function() { return this.get("DaysAtStageVisible"); }, /** * @private * @deprecated */ isMetricsContainerVisible: function() { return this.getIsFeatureEnabled("OpportunityMetrics"); }, }, dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/, diff: /**SCHEMA_DIFF*/[ { "operation": "insert", "parentName": "ProfileContainer", "propertyName": "items", "name": "MetricsContainer", "values": { "layout": {"column": 1, "row": 0,"rowSpan": 1, "colSpan": 24}, "itemType": Terrasoft.ViewItemType.CONTAINER, "classes": {"wrapClassName": ["ts-metrics-container"]}, "items": [], "visible": {"bindTo": "isMetricsContainerVisible"} } }, { "operation": "merge", "name": "PhotoTimeZoneContainer", "values": { "layout": { "colSpan": 24, "rowSpan": 1, "column": 0, "row": 1 } } }, { "operation": "insert", "parentName": "MetricsContainer", "propertyName": "items", "name": "MoodContainer", "values": { "items": [], "itemType": this.Terrasoft.ViewItemType.CONTAINER, "classes": {"wrapClassName": ["ts-metric-item", "ts-mood-container"]} } }, { "operation": "insert", "parentName": "MoodContainer", "propertyName": "items", "name": "OpportunityMood", "values": { "generator": "ImageListGenerator.generateImageList", "bindTo": "UsrMood", "id": "MoodImageList", "schemaName": "OpportunityMood", "schemaColumn": "Image", "caption": "LOL", "controlConfig": { "wrapClasses": ["opportunity-mood-image-list image-list"], "modalBoxClasses": ["opportunity-mood-image-list"] }, "markerValue": "OpportunityMood", "tips": [] }, "alias": { "name": "UsrMood", "excludeProperties": ["layout"], "excludeOperations": ["remove", "move"] } }, { "operation": "insert", "parentName": "OpportunityMood", "propertyName": "tips", "name": "UsrMood", "values": { "content": "LOL" } }, { "operation": "insert", "parentName": "MoodContainer", "propertyName": "items", "name": "MoodCaption", "values": { "itemType": Terrasoft.ViewItemType.LABEL, "caption": "LOL", "classes": {"labelClass": ["ts-metric-item-caption"]} } }]/**SCHEMA_DIFF*/ }; });
Alex_Tim,
Thanks @Alex code is working now. But after saving the page if you come to mini page that emote face was not showing it is showing like this.i want see emote symbol in the mini page also.
Here the code i did
define("ContactMiniPage", ["OpportunityMiniPageResources","css!OpportunityMiniPageCSS"],
function(miniPageResources, resources) {
return {
entitySchemaName: "Contact",
attributes: {
"UsrMood": {
lookupListConfig: {
orders: [{columnPath: "Position"}]
}
},
},
modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
methods: {
getOpportunityMoodImage: function() {
return (this.get("IsEntityInitialized") && this.isViewMode())
? this.getLookupImageUrl("Mood")
: this.getOpportunityMoodDefaultImage();
},
/**
* Returns opportunity default mood image url.
* @private
* @return {String} Photo image url.
*/
getOpportunityMoodDefaultImage: function() {
return Terrasoft.ImageUrlBuilder.getUrl(this.get("Resources.Images.DefaultOpportunityMood"));
},
},
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"parentName": "HeaderContainer",
"propertyName": "items",
"name": "OpportunityMoodContainer",
"values": {
"visible": {"bindTo": "isViewMode"},
"itemType": Terrasoft.ViewItemType.CONTAINER,
"wrapClass": ["opportunity-photo-container"],
"items": []
},
"index": 0
},
{
"operation": "insert",
"parentName": "OpportunityMoodContainer",
"propertyName": "items",
"name": "MiniPhoto",
"values": {
"getSrcMethod": "getOpportunityMoodImage",
"visible": {"bindTo": "isViewMode"},
"readonly": true,
"defaultImage": Terrasoft.ImageUrlBuilder.getUrl(
resources.localizableImages.DefaultOpportunityMood
),
"generator": "MiniPageViewGenerator.generateRoundImageControl"
}
},
]/**SCHEMA_DIFF*/
};
});