Skip to content
Snippets Groups Projects
Commit da2f1b3c authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '1060687_FixSupportticketOrganisationLink' into '2020.1'

[Projekt: Entwicklung - Neon][TicketNr.: 1060687][Supportticket - Neuanlage -...

See merge request xrm/basic!318
parents 41b8851f 3434de81
No related branches found
No related tags found
No related merge requests found
import("Contact_lib");
import("Ticket_lib");
import("Context_lib");
import("Attribute_lib");
......@@ -7,6 +8,16 @@ import("ActivityTask_lib");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", "$param.PresetLinks_param", "$field.TASK_PARENT_CONTEXT", "$field.TASK_PARENT_ID");
var presetLinks = JSON.parse(vars.getString("$param.PresetLinks_param"));
if(presetLinks[0][0] == "Person")
{
var contactId = presetLinks[0][1];
var orgContactId = ContactUtils.getOrganisationContactId(contactId);
presetLinks[1] = ["Organisation", orgContactId];
}
TaskUtils.addLinkRecords("$param.ObjectId_param", "$param.RowId_param", presetLinks, "$field.TASK_PARENT_CONTEXT", "$field.TASK_PARENT_ID");
AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes", TicketUtils.begin(vars.get("$field.TICKETTYPE")).getTypeAttributes());
}
\ 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