Question

Customer column in opportunity

Hi community!

 

I am trying to make uneditable the Customer column from Opportunity object based on the stages of the opportunity (dcm bar). My only issue is that I cannot find that column, in section wizard I find it as a script object - I am not sure how to work with that.

Thank you!

Like 0

Like

5 comments

Hi Nicolaiciuc Maria,



You can find this MultiLookup column implementation in the "BaseOpportunityPage" schema.



Attribute:

"Client": {
	"caption": {"bindTo": "Resources.Strings.Client"},
	"dataValueType": this.Terrasoft.DataValueType.LOOKUP,
	"multiLookupColumns": ["Contact", "Account"],
	"isRequired": true
},

Diff:

{
    "operation": "insert",
    "parentName": "ProfileContainer",
    "propertyName": "items",
    "name": "OpportunityClient",
    "values": {
        "bindTo": "Client",
        "layout": {
            "column": 0,
            "row": 1,
            "colSpan": 24
        },
        "tip": {
            "content": {
                "bindTo": "Resources.Strings.ClientTip"
            }
        },
        "controlWrapConfig": {
            "classes": {
                "wrapClassName": [
                    "client-edit-field"
                ]
            }
        },
        "controlConfig": {
            "enableLeftIcon": true,
            "leftIconConfig": {
                "bindTo": "getMultiLookupIconConfig"
            }
        }
    },
    "alias": {
        "name": "Client",
        "excludeProperties": [
            "layout"
        ],
        "excludeOperations": [
            "remove",
            "move"
        ]
    }
},

 

Please feel free to modify the below attribute in your "OpportunityPageV2" schema.

"Client": {
        "caption": {"bindTo": "Resources.Strings.Client"},
        "dataValueType": this.Terrasoft.DataValueType.LOOKUP,
        "multiLookupColumns": ["Contact", "Account"],
        "isRequired": true,
        "Enabled" : {"bindTo": setEnabled} 
    },



Add below in the Methods section of your "OpportunityPageV2" schema.

setEnabled : function(){
    //Your custom logic
    return true or false
    }



BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

Hello, and thank you for your help. I added the column in the attributes part of the schema and the function in the methods part. Unfortunately, in the console I get an error saying that my function is not defined. What should I look on further?

I am having the same issue and it is driving me mad. I followed the above steps but the page just hanged when trying to create a new opportunity. Has anyone resolved this?

 

Bhoobalan Palanivelu,

Hi Bhoobalan

 

I tried your solution and the page just hangs when creating a new Opportunity. It does not seem to like the new attribute code. Is there something else that needs to be added? 

 

Thanks in advance

Hi Rob,

The problem is that you need to write setEnabled in brackets:

"Enabled" : {"bindTo": "setEnabled"}



Also, instead of overriding attribute, you can add this to the diff:

 

{
				"operation": "merge",
				"name": "OpportunityClient",
				"values": {
					"enabled": {"bindTo": "setEnabled"} 
				}
			},

 

Show all comments