C# how do you execute code when a non custom button is clicked

Jose,
Just an update.  That worked a treat.  Now we have and Outlook message prepopulated with  Case Opening details to go back to our customers... Just need to work out how to automatically complete the last task on the task list on close and I’m done.
 
I believe there is a PreOpenCloseCase method so if I can use a BPM on that to set the values on the task etc I should be ok to go.  Or the alternative, don’t have a close task.
 
Anyway thanks for your tip earlier, much appreciated.
 
Cheers
Simon Hall
Hi everyone,
I want to be able to open the new outlook mail form when a user clicks the update button on the Task Management section on the Case (HelpDesk) form.

I believe I need to use the getnativecontrolreference with the GUID of the epiUpdateTask button (I think that is the correct name as I doing this for memory). 

But what next? Create a sub routine for the click event and then include my code.  I've actually tried that and whilst I get no compilation errors nothing actually happens when I  click the button.  I have setup a messagebox to fire for testing.

I have all of the other email functionality working in this form and it is the last piece.

So I guess the real question is....How do you access events for objects that already exist on a form that you are customizing and you don't have the SDK? Is there some other way that I am missing like running .NET code from a BPM perhaps. I had considered just using a global alert on the task, but the alert is read only and is setup to send to the salesperson, which is not who I need it to go to.

I'm hoping there is a quick and easy answer to this, as I could trawl the web for a long time trying to work it out.  We are on 9.05701.

Any assistance appreciated.

Simon Hall
You need to use csm.GetNativeControlRef("GUID"); as you mentioned then with the button you just got a hold of simply register an interest in the on Click event and in that event execute your code. Once thing I will warn you about is that if the button is already there it probably does something and you may be stepping on it by registering your own event.

InitCustomCode()

btn = (Button)csm,.GetNativeControlReference("GUID");

btn.Click += new System.EventHandler(btn_Click);


DisposeCustomCode()

btn.Click -= new System.EventHandler(btn_Click);




Your event function

 private void btn_Click(object sender, EventArgs e)
    {


    }






Jose C Gomez

Software Engineer


T: 904.469.1524 mobile

E: jose@…

http://www.josecgomez.com
     Â


Quis custodiet ipsos custodes?


On Wed, Nov 27, 2013 at 8:15 AM, <s1mhall@...> wrote:

Â
<div>
  
  
  <p>Hi everyone,<br>I want to be able to open the new outlook mail form when a user clicks the update button on the Task Management section on the Case (HelpDesk) form.<br><br>I believe I need to use the getnativecontrolreference with the GUID of the epiUpdateTask button (I think that is the correct name as I doing this for memory).  <br>


But what next? Create a sub routine for the click event and then include my code. I've actually tried that and whilst I get no compilation errors nothing actually happens when I click the button. I have setup a messagebox to fire for testing.


I have all of the other email functionality working in this form and it is the last piece.

So I guess the real question is…How do you access events for objects that already exist on a form that you are customizing and you don't have the SDK? Is there some other way that I am missing like running .NET code from a BPM perhaps. I had considered just using a global alert on the task, but the alert is read only and is setup to send to the salesperson, which is not who I need it to go to.


I'm hoping there is a quick and easy answer to this, as I could trawl the web for a long time trying to work it out. We are on 9.05701.

Any assistance appreciated.

Simon Hall

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

 Thanks Jose,

I'll give it a go.....Just of to work now in the trusty Kombi


Cheers

Simon Hall



---In vantage@yahoogroups.com, <jose@...> wrote:

You need to use csm.GetNativeControlRef("GUID"); as you mentioned then with the button you just got a hold of simply register an interest in the on Click event and in that event execute your code. Once thing I will warn you about is that if the button is already there it probably does something and you may be stepping on it by registering your own event.

InitCustomCode()

btn = (Button)csm,.GetNativeControlReference("GUID");

btn.Click += new System.EventHandler(btn_Click);


DisposeCustomCode()

btn.Click -= new System.EventHandler(btn_Click);




Your event function

 private void btn_Click(object sender, EventArgs e)
        {


        }






Jose C Gomez

Software Engineer


T: 904.469.1524 mobile


Quis custodiet ipsos custodes?


On Wed, Nov 27, 2013 at 8:15 AM, <s1mhall@...> wrote:

 
<div>
  
  
  <p>Hi everyone,<br>I want to be able to open the new outlook mail form when a user clicks the update button on the Task Management section on the Case (HelpDesk) form.<br><br>I believe I need to use the getnativecontrolreference with the GUID of the epiUpdateTask button (I think that is the correct name as I doing this for memory).&nbsp; <br>


But what next? Create a sub routine for the click event and then include my code.  I've actually tried that and whilst I get no compilation errors nothing actually happens when I  click the button.  I have setup a messagebox to fire for testing.


I have all of the other email functionality working in this form and it is the last piece.

So I guess the real question is…How do you access events for objects that already exist on a form that you are customizing and you don't have the SDK? Is there some other way that I am missing like running .NET code from a BPM perhaps. I had considered just using a global alert on the task, but the alert is read only and is setup to send to the salesperson, which is not who I need it to go to.


I'm hoping there is a quick and easy answer to this, as I could trawl the web for a long time trying to work it out.  We are on 9.05701.

Any assistance appreciated.

Simon Hall

</div>
 


<div style="color:rgb(255,255,255);min-height:0px;"></div>

 

 Thanks Jose,

I'll give it a go.....Just of to work now in the trusty Kombi


Cheers

Simon Hall



---In vantage@yahoogroups.com, <jose@...> wrote:

You need to use csm.GetNativeControlRef("GUID"); as you mentioned then with the button you just got a hold of simply register an interest in the on Click event and in that event execute your code. Once thing I will warn you about is that if the button is already there it probably does something and you may be s tepping on it by registering your own event.

InitCustomCode()
btn = (Button)csm,.GetNativeControlReference("GUID");
btn.Click += new System.EventHandler(btn_Click);


DisposeCustomCode()
btn.Click -= new System.EventHandler(btn_Click);



Your event function
 private void btn_Click(object sender, EventArgs e)
        {

        }





Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?


On Wed, Nov 27, 2013 at 8:15 AM, <s1mhall@...> wrote:
 

Hi everyone,
I want to be able to open the new outlook mail form when a user clicks the update button on the Task Management section on the Case (HelpDesk) form.

I believe I need to use the getnativecontrolreference with the GUID of the epiUpdateTask button (I think that is the correct name as I doing this for memory). 

But what next? Create a sub routine for the click event and then include my code.  I've actually tried that and whilst I get no compilation errors nothing actually happens when I  click the button.  I have setup a messagebox to fire for testing.

I have all of the other email functionality working in this form and it is the last piece.

So I guess the real question is....How do you access events for objects that already exist on a form that you are customizing and you don't have the SDK? Is there some other way that I am missing like running .NET code from a BPM perhaps. I had considered just using a global alert on the task, but the alert is read only and is setup to send to the salesperson, which is not who I need it to go to.

I'm hoping there is a quick and easy answer to this, as I could trawl the web for a long time trying to work it out.  We are on 9.05701.

Any assistance appreciated.

Simon Hall