现场服务计划板中的“自定义”选项卡 [英] Custom Tab in the Field Service Schedule Board

查看:104
本文介绍了现场服务计划板中的“自定义”选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了这个博客: http://www.powerobjects.com/2016/08/01/advanced-customizations-for-the-custom-tab-in-the-field-service-schedule- board /#collapse2

作者在其中描述了使用配置在现场服务计划板中创建新选项卡,将其指向CRM网络资源。

In it the author describes using configuration to create a new tab in the Field Services Schedule Board by pointing it to a CRM web resource.

博客包含以下javascript:

The blog includes the following javascript:

function updateBooking() 
{
   var entityRecordGuid = "10B8A40B-D499-E611-80E6-A45D36FC5A4C";

   // GUID is hardcoded to make the sample code easier to understand. 
   // We can extend this customization to be able to extract the selected booking IDs
   // from the SChedule Board's DOM, but that is out of scope for now  

   var bookableResourceBooking = new XrmServiceToolkit.Soap.BusinessEntity("bookableresourcebooking", entityRecordGuid);

   bookableResourceBooking.attributes["cus_urgency"] = document.getElementById('UrgencyInput').value;
   bookableResourceBooking.attributes["cus_notes"] = document.getElementById('NoteInput').value;

   var updateResponse = XrmServiceToolkit.Soap.Update(bookableResourceBooking);

   if (updateResponse == "") { // clear fields if synced to crm
       document.getElementById('UrgencyInput').value = "";
       document.getElementById('NoteInput').value = "";
   } else {
       alert('Data didn't sync to CRM');
   }
}

我遇到的问题是我我不确定如何动态获取 entityRecordGuid 值。

The problem that I've got is that I'm not sure how to get the entityRecordGuid value dynamically.


  • 似乎没有一种将Web资源配置为
    将选定项作为一部分的方法查询字符串

  • There doesn't seem to be a way of configuring the web resource to have the selected Item as part of the querystring

似乎有针对字段
Services的未记录JavaScript库;但是,我无法从Web资源 IFrame
访问它们,当然,它们没有文档记录。

There seem to be undocumented JavaScript libraries for Field Services; however, I can't access them from the web resource IFrame and of course, they're undocumented.

还有其他人试图这样做吗?我正在使用CRM Online

Has anyone else tried to do this? I'm using CRM Online

推荐答案

我最终通过直接抓取HTML而不是尝试使用任何API来完成此任务

I ended up doing this by scraping the HTML directly rather than trying to use any of the API methods from Field One.

这对我来说并不是一个令人满意的答案。这取决于计划外订单板上的订单是否定好,由于最终用户可以更改此订单,因此我的解决方案非常脆弱。

This wasn't really a satisfactory answer for me. It depends on the Unscheduled Orders board being in a certain order and since this is changeable by the end-user my solution is very fragile.

对于其他人,我确实设法找到了这些API方法;但是,我找不到关于它们的任何文档,因此请假定它们不受支持。我也无法将它们捆绑在一起以实现我想要的

For anyone else looking, I did manage to find these API methods; however, I couldn't find any documentation for them so assume that they are unsupported. I also couldn't tie them together to achieve what I wanted

// get the id of the sub grid
F1SDK.SchedulerPage.UnscheduledOrdersGrid.id          
    // -> "UnscheduledGrid"

F1SDK.SchedulerPage.UnscheduledOrdersGrid.getItemId() 
    // -> "UnscheduledGrid"

F1SDK.SchedulerPage.UnscheduledOrdersGrid.getStore().storeId 
    // -> "UnscheduledWorkOrders"

F1SDK.SchedulerPage.UnscheduledOrdersGrid.getStore().data.items[0].internalId
F1SDK.SchedulerPage.UnscheduledOrdersGrid.selModel.selected.items[0].internalId

// Get a subgrid
FieldOneSkyUtils.Subgrid.GetSubgrid('id')

F1SDK.data.models.WorkOrder.getFields()
F1SDK.data.models.WorkOrder.getIdByWONumber('00106')           
     // -> {55caa97d-429a-e611-80e6-c4346bc4bef0}

这篇关于现场服务计划板中的“自定义”选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆