分享方式:


編輯通用資源排程中的排程面板預約範本

當需求排程給資源時,系統會建立預約記錄。 排程面板顯示依資源分組的預約。 排程面板預約中顯示的欄位稱為預約範本,您可以使用系統實體中的欄位進行自訂。

編輯工單預約範本

每個啟用排程的實體都可以有不同的預約範本。 排程工單需求時,預約範本會顯示可預約資源預約記錄的名稱期間值。

預設值為下列程式碼片段:

<div>{SchedulableEntityDisplayName} - {name}<br />Duration: <strong class="bold">{duration}</strong></div>

若要編輯控制預約範本的 HTML,請移至排程面板設定中的排程類型區段。 選取您要變更預約範本的實體。 如果您從排程面板索引標籤中開啟這些設定,則只能變更該索引標籤的設定。 若要變更所有索引標籤,請選取編輯預設,並將變更套用到那裡。 將自訂預約範本設定為開啟,然後變更 HTML 程式碼。

預約範本欄位,覆寫預約範本,作法是輸入可參考可預約資源預約實體及連結實體中欄位的 HTML 和 CSS。 請務必在多個瀏覽器上測試自訂預約範本,並考慮協助工具的最佳做法。 預約範本不支援 JavaScript。

提示

僅使用系統實體。 不支援從自訂實體提取值。

可以在大括號中使用欄位名稱來直接參照可預約資源預約實體中的欄位。 範例:{duration}

若要顯示連結實體中的欄位,請尋找 N:1 關聯的名稱,然後在目標實體的欄位名稱後加上句點 (.)。 例如,工單關係路徑為 msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder,且主要事件類型欄位為 msdyn_primaryincidenttype。 這會造成欄位參考 {msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_primaryincidenttype}。 以額外期間來連接,以新增更多關聯跳算法。

自訂範本僅適用於排程面板每小時檢視表中的工具提示,不會影響每日、每週或每月檢視表。

自訂預約範本範例

對於此範例,我們為工單實體建立自訂預約範本。 下列程式碼片段會從與預約相關的工單提取值。

<div style="line-height: 11px !important; width: 99%; overflow: hidden; display: block; text-overflow: ellipsis;">
    WO: 
    <b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_name}</b><br/>
    Account: <b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_account_msdyn_workorder_ServiceAccount.name}</b><br/>
    Incident: <b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_primaryincidenttype}</b><br/>
    Duration: <b>{duration} minutes</b><br/>
</div>

注意

不支援參考排程面板預約範本中的約會屬性,因為約會範本資料取決於是否有相關聯的預約。

若要參考這些屬性,請確定約會有與其相關的預約,然後從排程參數停用包含約會設定。 停用此設定會隱藏排程面板中所有未有可預約資源預約與之連結的約會。

使用 CSS 設定進階預約範本的樣式

您可以使用 CSS 將樣式新增至自訂預約範本。 移至資源排程 > 管理 > 排程參數,並將停用安全清除 HTML 範本設定為,以將 CSS 陳述式包含在預約範本中。

在此範例中,我們擴充上一節中自訂預約範本的範例。 我們使用 CSS 根據客戶和工單記錄中的條件值來新增客戶評分和服務圖示。 自訂在客戶實體上新增了 new_customerrating 欄位,並以 1 到 10 的整數範圍將該欄位傳播到工單實體。 我們希望預約範本使用灰色星形來視覺化呈現客戶評分。 為了表示實際的客戶評分,我們還新增了五顆橙色星,但只是顯示這些星的百分比,以對應 1-10 的客戶評分。

我們還希望調度員查看工單是服務通話還是其他類型的工作。 自訂欄位在工單實體上建立了 new_isservicecall 欄位,有兩個可能值:0 或 1。 使用與上述相同的方法,我們先繪製灰色扳手作為背景、覆蓋橙色扳手,然後將其大小限制為 0% (new_isservicecall = 0) 或 100% (new_isservicecall = 1)。

新增下列 HTML 和 CSS 文字至排程面板索引標籤設定中的預約範本欄位。

<div style="line-height: 11px !important; width: 99%; overflow: hidden; display: block; text-overflow: ellipsis;">
<div class="back-stars" style="color: #AAAAAA; position: relative; display:inline-block;">
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
<div class="customerrating" style="width:{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_account_msdyn_workorder_ServiceAccount.new_customerrating}0%; color: #FFBC0B; position: absolute; top: 0; left:0; overflow: hidden; display:-webkit-box">
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
    <i class="fa fa-star" aria-hidden="true"></i>
</div>
</div>
<div class="repair-back" style="color: #AAAAAA; position: relative; display:inline-block; padding-left:10px; vertical-align:text-top;">
    <i class="fa fa-wrench" aria-hidden="true"></i>
<div class="repair" style="width:{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.new_isservicecall}00%; color: #FFBC0B; position: absolute; top: 0; left:0; padding-left:10px; overflow: hidden; display:-webkit-box">
    <i class="fa fa-wrench" aria-hidden="true"></i>
</div>
</div>
<br/>
WO:
<b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_name}</b><br/>
Account: <b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_account_msdyn_workorder_ServiceAccount.name}</b><br/>
Incident: <b>{msdyn_msdyn_workorder_bookableresourcebooking_WorkOrder.msdyn_primaryincidenttype}</b><br/>
Duration: <b>{duration} minutes</b><br/>
</div>

排程面板上的預約範本現在包含了客戶評等和工作類型的視覺表示。