This article explains the various configurations you can have Service Calls in calendars, as they are a bit special since they can be in single-user mode or multi-user mode for a single Service Call
What is Single user mode vs multi-user-mode
Single user mode is the default mode a company is in where the assignee is on the general tab and on the scheduling tab you see a single date/time for the Service Call.
Multi-user mode can optionally be activated in Document Settings, and if you do the scheduling tab will change into multiple dates/times with different technicians on each line.
Out-of-the-box Calendar from Boyum is designed for Single-user mode.
Modifying standard to support Multi-user mode
In order to use multi-user-mode, you need to do the following tweaks to the standard:
MSSQL:
SELECT
T0.callID AS 'PrimaryKey',
T1.Line AS 'SecondaryKey',
T1.StartDate AS 'StartDate',
T1.StartTime AS 'StartTime',
T1.EndDate AS 'EndDate',
T1.EndTime AS 'EndTime',
T0.objType AS 'ObjectType',
CONCAT(N'Service call ',T0.callID,': ', T0.subject) AS 'Subject',
T0.descrption AS 'Details'
FROM OSCL T0 WITH (NOLOCK)
JOIN SCL6 T1 WITH (NOLOCK) ON T0.callID = T1.SrcvCallID
WHERE (@StartDate BETWEEN T1.StartDate AND T1.EndDate OR T1.StartDate BETWEEN @StartDate AND @EndDate OR T1.EndDate BETWEEN @StartDate AND @EndDate)
AND T0.status <> -1
AND (
(T0.isQueue = 'N' AND T0.assignee = @UserId)
OR
(T0.isQueue = 'Y' AND T0.Queue = (SELECT MAX(TS0.queueID) FROM OQUE TS0 WITH (NOLOCK) JOIN QUE1 TS1 WITH (NOLOCK) ON TS0.queueID = TS1.queueID WHERE TS0.manager = @UserId OR TS1.member = @UserId))
)
HANA:
DO BEGIN
DECLARE StartDateVar DATETIME = @StartDate;
DECLARE EndDateVar DATETIME = @EndDate;
DECLARE UserIdVar INT = @UserId;
DECLARE FilterServiceCallPriorityVar NVARCHAR(20) = @FilterServiceCallPriority;
DECLARE FilterServiceCallOriginVar INT = @FilterServiceCallOrigin;
DECLARE FilterServiceCallProblemTypeVar INT = @FilterServiceCallProblemType;
DECLARE FilterServiceCallCallTypeVar INT = @FilterServiceCallCallType;
DECLARE FilterServiceCallStatusVar NVARCHAR(100) = @FilterServiceCallStatus;
SELECT
T0."callID" AS "PrimaryKey",
T1."Line" AS "SecondaryKey",
T1."StartDate" AS "StartDate",
T1."StartTime" AS "StartTime",
T1."EndDate" AS "EndDate",
T1."EndTime" AS "EndTime",
T0."objType" AS "ObjectType",
N'Service call ' || T0."callID" || ': ' || T0."subject" AS "Subject",
T0."descrption" AS "Details"
FROM "OSCL" T0
JOIN "SCL6" T1 ON T0."callID" = T1."SrcvCallID"
WHERE (StartDatevar BETWEEN T1."StartDate" AND T1."EndDate" OR T1."StartDate" BETWEEN StartDateVar AND EndDateVar OR T1."EndDate" BETWEEN StartDateVar AND EndDateVar)
AND T0."status" <> -1
AND (
(T0."isQueue" = 'N' AND T0."assignee" = UserIdVar)
OR
(T0."isQueue" = 'Y' AND T0."Queue" = (SELECT MAX(TS0."queueID") FROM "OQUE" TS0 JOIN "QUE1" TS1 ON TS0."queueID" = TS1."queueID" WHERE TS0."manager" = UserIdVar OR TS1."member" = UserIdVar))
)
AND (FilterServiceCallPriorityVar = '' OR T0."priority" = FilterServiceCallPriorityVar)
AND (FilterServiceCallOriginVar = -999 OR T0."origin" = FilterServiceCallOriginVar)
AND (FilterServiceCallProblemTypeVar = -999 OR T0."problemTyp" = FilterServiceCallProblemTypeVar)
AND (FilterServiceCallCallTypeVar = -999 OR T0."callType" = FilterServiceCallCallTypeVar)
AND (FilterServiceCallStatusVar = '' OR T0."status" = FilterServiceCallStatusVar);
END;
Comments
0 comments
Please sign in to leave a comment.