В разделе "активности" сделал что бы для разного типа записей открывались разные страницы.
На странице редактирования которая осталась деталь работает нормально.
А вот на новой странице имеет вот такой вид:
При попытке настроить колонки в консоль вываливается вот такая ошибка и страница зависает.
Где может быть косяк?
Код страницы:
define("Activity1Page", ["BaseFiltersGenerateModule", "ConfigurationEnums", "ConfigurationConstants",
"DuplicatesSearchUtilitiesV2"], function(BaseFiltersGenerateModule, Enums, ConfigurationConstants) {
return {
entitySchemaName: "Activity",
details: /**SCHEMA_DETAILS*/{
ActivityAddress: {
schemaName: "ActivityAddressDetailV2",
filter: {
masterColumn: "Id",
detailColumn: "Activity"
}
}
}/**SCHEMA_DETAILS*/,
messages: {
"DetailChanged": {
mode: this.Terrasoft.MessageMode.PTP,
direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
}
},
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"parentName": "Header",
"propertyName": "items",
"name": "CustomerLocation",
"values": {
"bindTo": "CustomerLocation",
"layout": {"column": 6, "row": 4, "colSpan": 6},
"enabled": {"bindTo": "isAccountSet"}
}
},
{
"operation": "merge",
"parentName": "Header",
"propertyName": "items",
"name": "ShowInScheduler",
"values": {
"bindTo": "ShowInScheduler",
"layout": {"column": 0, "row": 4, "colSpan": 6}
}
},
{
"operation":"remove",
"name":"ProfileContainer"
},
{
"operation":"remove",
"name":"Priority"
},
{
"operation":"insert",
"name":"Topic",
"propertyName": "items",
"parentName": "Header",
"values": {
"layout": { "column": 12, "row": 3, "colSpan": 12 },
"bindTo": "Topic"
}
},
{
"operation": "insert",
"parentName": "GeneralInfoTab",
"propertyName": "items",
"name": "ActivityAddress",
"index":0,
"values": {
"itemType": Terrasoft.ViewItemType.DETAIL
}
}
]/**SCHEMA_DIFF*/,
methods: {
isAccountSet: function(){
if(!this.get("Account")){
this.set("CustomerLocation",false);
}
return (this.get("Account"))? true : false;
},
onEntityInitialized: function () {
this.callParent(arguments);
this.setActivityCategory();
this.sandbox.subscribe("DetailChanged", function(){this.setMeetingNotes();},this,["somekey"]);
},
onDetailChanged: function () {
this.callParent(arguments);
this.setMeetingNotes();
},
onSaved: function () {
if(this.get("Operation")=="add" && this.get("CustomerLocation")){
this.addCustomerLocation();
this.set("Operation","edit");
}
this.callParent(arguments);
},
changeSubject: function(){
this.set("Title",(this.get("Account")?this.get("Account").displayValue:"") + " / EVOQIA: " + (this.get("Topic")?this.get("Topic"):""));
},
setMeetingNotes: function(){
var selectQuery = Ext.create("Terrasoft.EntitySchemaQuery", {
rootSchemaName: "ActivityAddress"
});
/*****************************************/
}
},
addCustomerLocation: function(){
var deleteQuery = this.Ext.create("Terrasoft.DeleteQuery", {
rootSchemaName: "ActivityAddress"
});
/*****************************/
},
changeAddress: function(){
if(this.get("CustomerLocation")){
if(this.get("Operation")=="add"){
this.save({isSilent:true});
}else{
this.addCustomerLocation();
}
}else{
var deleteQuery = this.Ext.create("Terrasoft.DeleteQuery", {
rootSchemaName: "ActivityAddress"
});
var entityIdFilter = Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, "Activity", this.get("Id"));
deleteQuery.filters.add("entityIdFilter", entityIdFilter);
deleteQuery.execute(function(){this.updateDetails();this.setMeetingNotes();},this);
}
}
},
rules: {},
attributes: {
"Subject":{
dataValueType: Terrasoft.DataValueType.ENUM,
dependencies: [
{
columns: ["Topic", "Account"],
methodName: "changeSubject"
}
]
},
"CustomerLocationAddress":{
dependencies: [
{
columns: ["CustomerLocation"],
methodName: "changeAddress"
}
]
}
}
};
});
"DuplicatesSearchUtilitiesV2"], function(BaseFiltersGenerateModule, Enums, ConfigurationConstants) {
return {
entitySchemaName: "Activity",
details: /**SCHEMA_DETAILS*/{
ActivityAddress: {
schemaName: "ActivityAddressDetailV2",
filter: {
masterColumn: "Id",
detailColumn: "Activity"
}
}
}/**SCHEMA_DETAILS*/,
messages: {
"DetailChanged": {
mode: this.Terrasoft.MessageMode.PTP,
direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
}
},
diff: /**SCHEMA_DIFF*/[
{
"operation": "insert",
"parentName": "Header",
"propertyName": "items",
"name": "CustomerLocation",
"values": {
"bindTo": "CustomerLocation",
"layout": {"column": 6, "row": 4, "colSpan": 6},
"enabled": {"bindTo": "isAccountSet"}
}
},
{
"operation": "merge",
"parentName": "Header",
"propertyName": "items",
"name": "ShowInScheduler",
"values": {
"bindTo": "ShowInScheduler",
"layout": {"column": 0, "row": 4, "colSpan": 6}
}
},
{
"operation":"remove",
"name":"ProfileContainer"
},
{
"operation":"remove",
"name":"Priority"
},
{
"operation":"insert",
"name":"Topic",
"propertyName": "items",
"parentName": "Header",
"values": {
"layout": { "column": 12, "row": 3, "colSpan": 12 },
"bindTo": "Topic"
}
},
{
"operation": "insert",
"parentName": "GeneralInfoTab",
"propertyName": "items",
"name": "ActivityAddress",
"index":0,
"values": {
"itemType": Terrasoft.ViewItemType.DETAIL
}
}
]/**SCHEMA_DIFF*/,
methods: {
isAccountSet: function(){
if(!this.get("Account")){
this.set("CustomerLocation",false);
}
return (this.get("Account"))? true : false;
},
onEntityInitialized: function () {
this.callParent(arguments);
this.setActivityCategory();
this.sandbox.subscribe("DetailChanged", function(){this.setMeetingNotes();},this,["somekey"]);
},
onDetailChanged: function () {
this.callParent(arguments);
this.setMeetingNotes();
},
onSaved: function () {
if(this.get("Operation")=="add" && this.get("CustomerLocation")){
this.addCustomerLocation();
this.set("Operation","edit");
}
this.callParent(arguments);
},
changeSubject: function(){
this.set("Title",(this.get("Account")?this.get("Account").displayValue:"") + " / EVOQIA: " + (this.get("Topic")?this.get("Topic"):""));
},
setMeetingNotes: function(){
var selectQuery = Ext.create("Terrasoft.EntitySchemaQuery", {
rootSchemaName: "ActivityAddress"
});
/*****************************************/
}
},
addCustomerLocation: function(){
var deleteQuery = this.Ext.create("Terrasoft.DeleteQuery", {
rootSchemaName: "ActivityAddress"
});
/*****************************/
},
changeAddress: function(){
if(this.get("CustomerLocation")){
if(this.get("Operation")=="add"){
this.save({isSilent:true});
}else{
this.addCustomerLocation();
}
}else{
var deleteQuery = this.Ext.create("Terrasoft.DeleteQuery", {
rootSchemaName: "ActivityAddress"
});
var entityIdFilter = Terrasoft.createColumnFilterWithParameter(
this.Terrasoft.ComparisonType.EQUAL, "Activity", this.get("Id"));
deleteQuery.filters.add("entityIdFilter", entityIdFilter);
deleteQuery.execute(function(){this.updateDetails();this.setMeetingNotes();},this);
}
}
},
rules: {},
attributes: {
"Subject":{
dataValueType: Terrasoft.DataValueType.ENUM,
dependencies: [
{
columns: ["Topic", "Account"],
methodName: "changeSubject"
}
]
},
"CustomerLocationAddress":{
dependencies: [
{
columns: ["CustomerLocation"],
methodName: "changeAddress"
}
]
}
}
};
});
Нравится
1 комментарий
9 ноября 2016 13:56
Добрый день, Ярослав.
Данная ошибка связана с тем, что для данной детали еще нет настроек колонок (в таблице SysProfileData нет записи по данной детали расположенной на новой карточке) и она пытается подгрузить настройки из tiledConfig схемы детали.
Для исправления необходимо настроить колонки. Запись в таблице появится и tiledConfig не будет отрабатывать.
Показать все комментарии
Войдите или зарегистрируйтесь, что бы комментировать