Skip to content
Snippets Groups Projects
Commit 48f82eda authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch 'sales_1086832_FixResponsibleFilterAndDisplayIn360Degree' into '2021.2.0'

Sales 1086832 fix responsible filter and display in360 degree

See merge request xrm/basic!1283
parents 4831fbb1 57f5adf0
No related branches found
No related tags found
No related merge requests found
......@@ -98,19 +98,39 @@ function _get360Data(pContactId, pContextList)
group = row[pContextList[context]["setGroupBy"]]
}
if(context == "Salesproject" && !ContactUtils.isOrganisation(pContactId))//add roles to the description
if(context == "Salesproject")
{
description = description + " | " + translate.text("Role") + ": "
if(roleObj.hasOwnProperty(salesProjectId))
if(!ContactUtils.isOrganisation(pContactId))//add roles to the description if person dataset
{
var roles = roleObj[salesProjectId];
for (let i = 0; i < roles.length; i++)
description = description + " | " + translate.text("Role") + ": "
if(roleObj.hasOwnProperty(salesProjectId))
{
if(i != 0)
var roles = roleObj[salesProjectId];
for (let i = 0; i < roles.length; i++)
{
description = description + ", ";
if(i != 0)
{
description = description + ", ";
}
description = description + roles[i];
}
description = description + roles[i];
}
}
//add responsible to the description
var responsibleContactId = newSelect("OBJECTMEMBER.CONTACT_ID")
.from("OBJECTMEMBER")
.where("OBJECTMEMBER.OBJECT_TYPE", "Salesproject")
.and("OBJECTMEMBER.OBJECT_ROWID", targetid)
.and("OBJECTMEMBER.RESPONSIBLE", "1")
.cell();
if(responsibleContactId)
{
var responsibleName = ContactUtils.getFullTitleByContactId(responsibleContactId, false);
if(!Utils.isNullOrEmpty(responsibleName))
{
description = description + " | " + translate.text("Responsible") + ": " + responsibleName;
}
}
}
......
......@@ -1328,6 +1328,14 @@
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>Salesprojects</name>
<dependency>
<name>dependency</name>
<entityName>Salesproject_entity</entityName>
<fieldName>Salesprojects</fieldName>
</dependency>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -1809,8 +1817,8 @@
<name>SalesprojectResponsible_filter</name>
<title>Salesproject: Responsible</title>
<contentType>TEXT</contentType>
<consumer>Salutations</consumer>
<filterValuesProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterValuesProcess.js</filterValuesProcess>
<useConsumer v="true" />
<consumer>Salesprojects</consumer>
<filterConditionProcess>%aditoprj%/entity/Person_entity/recordcontainers/db/filterextensions/salesprojectresponsible_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtension>
......
import("system.result");
import("Sql_lib");
var salesProjects = newSelect("SALESPROJECT.SALESPROJECTID, SALESPROJECT.PROJECTTITLE")
.from("SALESPROJECT")
.table();
result.object(salesProjects);
\ No newline at end of file
......@@ -890,6 +890,14 @@
<name>IgnoreOrderBy_param</name>
<expose v="true" />
</entityParameter>
<entityConsumer>
<name>Contacts</name>
<dependency>
<name>dependency</name>
<entityName>Person_entity</entityName>
<fieldName>Contacts</fieldName>
</dependency>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -1145,15 +1153,15 @@
<filterExtensionSet>
<name>Member_filter</name>
<filterFieldsProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterFieldsProcess.js</filterFieldsProcess>
<filterValuesProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterValuesProcess.js</filterValuesProcess>
<filterConditionProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/member_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtensionSet>
<filterExtension>
<name>Responsible_filter</name>
<title>Responsible</title>
<contentType>BOOLEAN</contentType>
<filterValuesProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterValuesProcess.js</filterValuesProcess>
<contentType>TEXT</contentType>
<useConsumer v="true" />
<consumer>Contacts</consumer>
<filterConditionProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/responsible_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtension>
......
......@@ -20,7 +20,8 @@ for (var i = 0; i < roles.length; i++)
title: translate.text("Role") + ": " + roles[i][1],
contentType: "TEXT",
hasDropDownValues: true,
isGroupable: false
isGroupable: false,
consumer: "Contacts"
});
}
......
import("system.result");
import("Contact_lib");
import("Sql_lib");
var values = newSelect(["CONTACT.CONTACTID", ContactUtils.getResolvingDisplaySubSql("CONTACT.CONTACTID", true, true)])
.from(ContactUtils.getFullContactString())
.where("CONTACT.PERSON_ID is not null")
.table();
result.object(values);
\ No newline at end of file
......@@ -9,7 +9,8 @@ var responsibleSql = newSelect("OBJECTMEMBER.CONTACT_ID")
.from("OBJECTMEMBER")
.where("OBJECTMEMBER.OBJECT_TYPE", "Salesproject")
.and("OBJECTMEMBER.OBJECT_ROWID = SALESPROJECT.SALESPROJECTID")
.and("OBJECTMEMBER.RESPONSIBLE", 1);
.and("OBJECTMEMBER.RESPONSIBLE", 1)
.andIfSet("OBJECTMEMBER.CONTACT_ID", rawValue);
var condType = SqlBuilder.EXISTS();
......
import("system.translate");
import("system.result");
result.object([["true", translate.text("Yes")], ["false", translate.text("No")]]);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment