Question

Method is not calling properly from the dependencies listed in attributes

Hello All,

When selecting the location in Opportunity Product Page, the corresponding term (read-only field) from the Account Address in Opportunity schema needs to be set automatically .

 

While debugging my code, I have added some break points and tried to check whether the 'term' value is set properly on my code, while selecting the location.

 

But the setTermValues () function is not calling from the dependencies set in "AtsLocation" attribute. I have checked the console where there are no errors. I have also validated my code but I am not sure why the 'term' is not setting up properly.

 

attributes:

{

 

"AtsLocation": {

lookupListConfig: {

filters: [

function() {

var filterGroup = Ext.create("Terrasoft.FilterGroup");

var oportunity = this.get("Opportunity");

filterGroup.addItem(this.Terrasoft.createColumnFilterWithParameter(

this.Terrasoft.ComparisonType.EQUAL,

"[AtsAccountAddressInOpportunity:Id:Id].AtsOpportunity.Id",

oportunity.value));

return filterGroup;

}

],

columns: [

"AtsAccAddress.AtsLATA",

"AtsAccAddress.AtsZone",

"AtsTerm"

]

},

dependencies: [{

columns: ["AtsAccountAddressInOpportunity.AtsTerm"],

methodName: "setTermValues" // The 

}]

}

},

 

methods: 

{

 

setTermValues: function () {   //This function is not calling when I debug my code.

var location = this.get("AtsAccountAddressInOpportunity.AtsAccAddress");

var term = this.get("AtsAccountAddressInOpportunity.AtsTerm")

if (location) {

this.set("AtsTerm",term.value);

}

}

}

 

Please let me know if I am missing something here.  Appreciate your help.

 

 

File attachments

Like

1 comments

You can't use connected fields in the dependencies. 

columns: ["AtsAccountAddressInOpportunity.AtsTerm"],

You need to use business rules to resolve this task. 

Unfortunately, auto generated business rules don't support autocomplete yet.

Please use custom business rules as described in the article

https://academy.bpmonline.com/documents/technic-sdk/7-9/adding-filtrati…

Show all comments