简体   繁体   English

FireRequestAction 不会在按钮点击时触发

[英]FireRequestAction not firing on button click

I have created a windows form hosted control.我创建了一个 Windows 窗体托管控件。 And I want to change focus on button click of Hosted Control to another application inside Unified Service Desk.我想将焦点从单击托管控制的按钮转移到 Unified Service Desk 中的另一个应用程序。

On Button Click event I am using below code,在按钮单击事件上,我使用以下代码,

 private void button1_Click(object sender, EventArgs e)
 {
     FireRequestAction(new RequestActionEventArgs("CRM Global Manager", 
                       "ShowTab", "test application"));    
 }

but for some reason it is not getting fired.但由于某种原因,它没有被解雇。 If i perform any other operation inside this code block like for example displaying a messageBox it works fine.如果我在此代码块中执行任何其他操作,例如显示一个 messageBox,它工作正常。 But unable to fire this action.但是无法触发这个动作。

Never FireRequestAction.从不 FireRequestAction。 Instead, always FireEvent, and then define Event and Action Call records in the USD configuration (rather than in the Hosted Control code, as you have been attempting).相反,始终使用 FireEvent,然后在 USD 配置中定义事件和操作调用记录(而不是您一直在尝试的托管控制代码中)。

In this instance, call FireEvent and provide the event with a meaningful name.在这种情况下,调用 FireEvent 并为事件提供一个有意义的名称。 Next, write no further code.接下来,不再编写任何代码。 Proceed to the configuration.继续进行配置。 On your Hosted Control record, create a new Event record with an identical name.在您的托管控制记录上,创建一个具有相同名称的新事件记录。 If applicable, relate it to your Configuration record.如果适用,请将其与您的配置记录相关联。 On this Event, add an Action Call to have the Global Manager do a ShowTab on your test application, and if applicable, relate this to your Configuration record as well.在此事件上,添加一个操作调用,让全局管理器在您的测试应用程序上执行 ShowTab,如果适用,还将其与您的配置记录相关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM