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

Merge branch 'sales_1084806_FixVisitPlanCalendarFunctionUsage' into '2021.1'

[Projekt: xRM-Sales][TicketNr.: 1084806][Besuchsplannungs Datensätze über...

See merge request xrm/basic!1189
parents 31397d82 6c87c27c
No related branches found
No related tags found
No related merge requests found
...@@ -200,7 +200,7 @@ ...@@ -200,7 +200,7 @@
</dependency> </dependency>
<children> <children>
<entityParameter> <entityParameter>
<name>AppointmentId_param</name> <name>VisitPlanId_param</name>
<valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/appointmentlinks/children/appointmentid_param/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/appointmentlinks/children/appointmentid_param/valueProcess.js</valueProcess>
</entityParameter> </entityParameter>
<entityParameter> <entityParameter>
...@@ -268,6 +268,10 @@ ...@@ -268,6 +268,10 @@
<valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/Appointment_entity/entityfields/erroronpermissiondenied/valueProcess.js</valueProcess>
<expose v="true" /> <expose v="true" />
</entityParameter> </entityParameter>
<entityParameter>
<name>VisitPlanId_param</name>
<expose v="true" />
</entityParameter>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<jDitoRecordContainer> <jDitoRecordContainer>
......
import("Sql_lib");
import("system.calendars"); import("system.calendars");
import("system.question"); import("system.question");
import("system.translate"); import("system.translate");
...@@ -43,3 +44,8 @@ event[calendars.ID] = calendars.insert([event])[0]; ...@@ -43,3 +44,8 @@ event[calendars.ID] = calendars.insert([event])[0];
neon.setFieldValue("$field.UID", event[calendars.ID]); neon.setFieldValue("$field.UID", event[calendars.ID]);
vars.set("$context.editmode", calendars.MODE_UPDATE); vars.set("$context.editmode", calendars.MODE_UPDATE);
if(vars.exists("$param.VisitPlanId_param") && vars.get("$param.VisitPlanId_param"))
{
newWhere("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$param.VisitPlanId_param")).updateData(true, "VISITPLANENTRY", ["APPOINTMENT_ID"], null, [event[calendars.ID]]);
}
\ No newline at end of file
...@@ -45,8 +45,9 @@ var params = { ...@@ -45,8 +45,9 @@ var params = {
"Entry_param": JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, start, "Entry_param": JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, start,
end, undefined, undefined, undefined, [standardMail], end, undefined, undefined, undefined, [standardMail],
undefined, undefined, undefined)) undefined, undefined, undefined))
, "VisitPlanId_param": selectionRowData[0]["#UID"]
}; };
neon.openContext("Appointment", "AppointmentEdit_view", [vars.get("$field.UID")], neon.OPERATINGSTATE_NEW, params, null); neon.openContext("Appointment", "AppointmentEdit_view", null, neon.OPERATINGSTATE_NEW, params, null);
result.string(true); result.string(true);
import("system.calendars");
import("system.vars"); import("system.vars");
import("Calendar_lib"); import("Calendar_lib");
import("system.neon"); import("system.neon");
...@@ -10,12 +11,7 @@ var recommendationId = vars.get("$field.VISITRECOMMENDATION_ID"); ...@@ -10,12 +11,7 @@ var recommendationId = vars.get("$field.VISITRECOMMENDATION_ID");
newWhere("VISITRECOMMENDATION.VISITRECOMMENDATIONID", recommendationId) newWhere("VISITRECOMMENDATION.VISITRECOMMENDATIONID", recommendationId)
.updateData(true, "VISITRECOMMENDATION", ["STATUS"], null, [""]); .updateData(true, "VISITRECOMMENDATION", ["STATUS"], null, [""]);
new SqlBuilder(SqlUtils.getSystemAlias()).whereIfSet("ASYS_CALENDARBACKEND.ELEMENTUID", id) calendars.removeEntryByUID(calendars.VEVENT, null, id, null)
.deleteData();
newWhereIfSet("AB_APPOINTMENTLINK.APPOINTMENT_ID", id)
.deleteData();
newWhereIfSet("VISITPLANENTRY.VISITPLANENTRYID", "$field.UID") newWhereIfSet("VISITPLANENTRY.VISITPLANENTRYID", "$field.UID")
.deleteData(); .deleteData();
\ 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