Skip to content
Snippets Groups Projects
Commit 346975ac authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '1065068_FixContactFunctionToPrivatPerson' into '2020.2.0'

[Projekt: Entwicklung - Neon][TicketNr.: 1065068][Funktion zu Privat Person...

See merge request xrm/basic!372
parents 2b4db9cf 4c4b8db9
No related branches found
No related tags found
No related merge requests found
......@@ -5,9 +5,10 @@ import("system.db");
import("system.vars");
import("Entity_lib");
import("Sql_lib");
import("Organisation_lib");
var personId = vars.getString("$field.PERSON_ID");
var organisationId;
var organisationId, validationMsg;
var orgContactId = vars.get("$local.value");
var organisationIds = ContactUtils.getPersOrgIds(orgContactId)
......@@ -19,8 +20,19 @@ if (organisationIds.length > 0 && organisationIds[2])
if (vars.get("$field.CONTACTID"))
contactId = vars.get("$field.CONTACTID");
var validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, contactId);
validationMsg = ContactUtils.validateIfAlreadyExists(personId, organisationId, contactId);
if (validationMsg)
result.string(validationMsg);
}
else
{
var privateCount = newSelect("count(*)")
.from("CONTACT")
.where("CONTACT.ORGANISATION_ID", OrgUtils.getPrivateOrganisationId())
.and("CONTACT.CONTACTID", vars.get("$param.OwnContactId_param"))
.cell();
if(privateCount > 0)
validationMsg = translate.text("A person can only have one private Contact.");
if(validationMsg)
result.string(validationMsg)
}
\ No newline at end of file
import("Organisation_lib");
import("system.vars");
import("system.neon");
//TODO: workaround till there exists somtehing that can be done "beforeSave"; a validation of the whole entity is done before saving so let's use this process at the moment
if(!vars.get("$field.ORGANISATION_ID"))
{
neon.setFieldValue("$field.ORGANISATION_ID", "0");
neon.setFieldValue("$field.ORGANISATION_ID", OrgUtils.getPrivateOrganisationId());
}
\ No newline at end of file
......@@ -7368,6 +7368,54 @@
<entry>
<key>Mark all cached record containers as invalid</key>
</entry>
<entry>
<key>%0 of the chosen records are already recipients.</key>
</entry>
<entry>
<key>Set missing address locations</key>
</entry>
<entry>
<key>Set all address locations</key>
</entry>
<entry>
<key>Shows the number of Activities of the Grouped Fields</key>
</entry>
<entry>
<key>The status of the offer was changed to \"sent\".</key>
</entry>
<entry>
<key>Sales Staff Activity</key>
</entry>
<entry>
<key>Titel</key>
</entry>
<entry>
<key>Month</key>
</entry>
<entry>
<key>Responsible Department</key>
</entry>
<entry>
<key>Shows the different conversion rates of the sales project phases</key>
</entry>
<entry>
<key>FavoriteFilter_view</key>
</entry>
<entry>
<key>Salesproject Convertion Rates</key>
</entry>
<entry>
<key>The status of the order was changed to \"sent\".</key>
</entry>
<entry>
<key>Conversion Rate</key>
</entry>
<entry>
<key>AB_KEYWORD_ENTRYID</key>
</entry>
<entry>
<key>A person can only have one private Contact.</key>
</entry>
<entry>
<key>Linked in (Person)</key>
</entry>
......
......@@ -2669,6 +2669,10 @@
<key>Fiji</key>
<value>Fidschi</value>
</entry>
<entry>
<key>A person can only have one private Contact.</key>
<value>Eine Person kann nur einen privaten Kontakt haben.</value>
</entry>
<entry>
<key>Guinea</key>
<value>Guinea</value>
......@@ -9463,6 +9467,39 @@ Bitte Datumseingabe prüfen</value>
<entry>
<key>Xing (Person)</key>
</entry>
<entry>
<key>Date must not be in the future</key>
</entry>
<entry>
<key>Shows the number of Activities of the Grouped Fields</key>
</entry>
<entry>
<key>Sales Staff Activity</key>
</entry>
<entry>
<key>Month</key>
</entry>
<entry>
<key>Responsible Department</key>
</entry>
<entry>
<key>Shows the different conversion rates of the sales project phases</key>
</entry>
<entry>
<key>Salesproject Convertion Rates</key>
</entry>
<entry>
<key>Date has to be in the selected calendar week!</key>
</entry>
<entry>
<key>50-99 D€</key>
</entry>
<entry>
<key>Conversion Rate</key>
</entry>
<entry>
<key>AB_KEYWORD_ENTRYID</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
......@@ -7453,19 +7453,19 @@
<key>Current Recipients</key>
</entry>
<entry>
<key>Date (Month)</key>
<key>The status of the offer was changed to \"sent\".</key>
</entry>
<entry>
<key>Date (Year)</key>
<key>The status of the order was changed to \"sent\".</key>
</entry>
<entry>
<key>Date (Day)</key>
<key>Conversion Rate</key>
</entry>
<entry>
<key>Grant new User Permission</key>
<key>AB_KEYWORD_ENTRYID</key>
</entry>
<entry>
<key>%0 of the chosen records are already recipients.</key>
<key>A person can only have one private Contact.</key>
</entry>
<entry>
<key>Linked in (Person)</key>
......
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