Access CallContextBPM Data in C# code

That’s good to know.  I always thought it was a static class.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Friday, November 15, 2013 9:47 AM
To: Vantage
Subject: Re: [Vantage] RE: RE: Access CallContextBPM Data in C# code

 

 

CallContextBpmData is supposed to  be ubiquitous (for a given screen) so that any call you make within the same screen should carry it.



Jose C Gomez

Software Engineer

 


T: 904.469.1524 mobile


Quis custodiet ipsos custodes?

 

On Fri, Nov 15, 2013 at 9:30 AM, <livingstonmh@...> wrote:

 

Ok after so research I think I figured out why I am not getting the data.

 

From what I understand the CallContextBPMData is for specific. Is it possible that since I am using a data directive that I am writing to the wrong callcontext? I am calling the   TransferWorkBenchDataSet.GetByID method, so I am gussing that might be where it is pulling the callcontext data from. Does anyone know if it would be possible to change the Context data that I am writing to?



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

If you see my response I posted the code. It is on a customized replenishment workbench form.

 

I know that the  MessageBox.Show(string.Concat("Orders Created\n",Orders)); only displays at the end, so I put the code at the end of the private void CreateOrder(Infragistics.Win.UltraWinGrid.UltraGridRow row).

 

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

Since your c# code is in a customization, maybe you're accesing that field before your bpm triggers? What form/method are you putting your code on?

 

 

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

I need to access data that was written to the CallContextBPM.Character01 field in C#

 

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

 

I need to access data that was written to the CallContextBPM.Character01 field in C#

 

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

That usually works though I've experienced that with the Hand Held Screens the call context doens't seem to carry through. Not sure about that workbench may be the same situation


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Fri, Nov 15, 2013 at 8:52 AM, <livingstonmh@...> wrote:

Â
<div>
  
  
  <p></p><p></p><p>I need to access data that was written to the CallContextBPM.Character01 field in C#</p><p>Â </p><p>I am using the below now:</p><p>Â Â EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews[&quot;CallContextBpmData&quot;]));<br>

  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

Â

However it is always showing empty.

Â

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

Â

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

Â

Anyone have any ideas on how to do this?

</div>
 


<div style="color:#fff;min-height:0;"></div>

Since your c# code is in a customization, maybe you're accesing that field before your bpm triggers? What form/method are you putting your code on?




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

I need to access data that was written to the CallContextBPM.Character01 field in C#

 

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

 I know there is a field because I can show an info box from the BPM that displays the TFOrdNum.

Do you know of any other way that this can be done? Following is my code

 

private void btnProcess_Click(object sender, System.EventArgs args)
    {
        foreach (Infragistics.Win.UltraWinGrid.UltraGridRow row in grdResults.Rows)       
            if (Convert.ToBoolean(row.Cells[0].Value))
                CreateOrder(row);

        UpdateGrid(cmbFromWH.Text, cmbToWH.Text);
  MessageBox.Show(string.Concat("Orders Created\n",Orders));
        //MessageBox.Show("Complete!");
  Orders="";
    }

    private void CreateOrder(Infragistics.Win.UltraWinGrid.UltraGridRow row)
    {
        TransferWorkBench wb          = new TransferWorkBench(((Session)oTrans.Session).ConnectionPool);
        TransferWorkBenchDataSet wbDS = wb.GetByID(row.Cells[9].Value.ToString());
  
  
        wbDS.TFOrdDtl[0].OrderFirm         = true;
        wbDS.TFOrdDtl[0].CreateOrder       = true;       
        wbDS.TFOrdDtl[0].RequiredQty       = Convert.ToDecimal(row.Cells[8].Value);
        wbDS.TFOrdDtl[0].OurStockQty       = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].SellingQty        = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].ThisOrderInvtyQty = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].Selected          = true;
        wb.Update(wbDS);
        wbDS.TFOrdDtl[0].OrderFirm         = true;
        wbDS.TFOrdDtl[0].CreateOrder       = true;
        wbDS.TFOrdDtl[0].RequiredQty       = Convert.ToDecimal(row.Cells[8].Value);
        wbDS.TFOrdDtl[0].OurStockQty       = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].SellingQty        = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].ThisOrderInvtyQty = wbDS.TFOrdDtl[0].RequiredQty;
        wbDS.TFOrdDtl[0].Selected          = true;
  wb.ProcessNewSuggestions(wbDS);
  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  Orders =  string.Concat(Orders, edvts);
  Orders = string.Concat(Orders, "\n");
 

    }

 

When running this for 3 parts I get a box:

 

Start

Orders Created

 

 

 

End



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

That usually works though I've experienced that with the Hand Held Screens the call context doens't seem to carry through. Not sure about that workbench may be the same situation


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile


Quis custodiet ipsos custodes?


On Fri, Nov 15, 2013 at 8:52 AM, <livingstonmh@...> wrote:

 
<div>
  
  
  <p>I need to access data that was written to the CallContextBPM.Character01 field in C#</p><p>&nbsp;</p><p>I am using the below now:</p><p>&nbsp;&nbsp;EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews[&quot;CallContextBpmData&quot;]));<br>

  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

</div>
 


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

If you see my response I posted the code. It is on a customized replenishment workbench form.

 

I know that the  MessageBox.Show(string.Concat("Orders Created\n",Orders)); only displays at the end, so I put the code at the end of the private void CreateOrder(Infragistics.Win.UltraWinGrid.UltraGridRow row).



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

Since your c# code is in a customization, maybe you're accesing that field before your bpm triggers? What form/method are you putting your code on?




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

I need to access data that was written to the CallContextBPM.Character01 field in C#

 

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

Ok after so research I think I figured out why I am not getting the data.

 

From what I understand the CallContextBPMData is for specific. Is it possible that since I am using a data directive that I am writing to the wrong callcontext? I am calling the   TransferWorkBenchDataSet.GetByID method, so I am gussing that might be where it is pulling the callcontext data from. Does anyone know if it would be possible to change the Context data that I am writing to?



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

If you see my response I posted the code. It is on a customized replenishment workbench form.

 

I know that the  MessageBox.Show(string.Concat("Orders Created\n",Orders)); only displays at the end, so I put the code at the end of the private void CreateOrder(Infragistics.Win.UltraWinGrid.UltraGridRow row).



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

Since your c# code is in a customization, maybe you're accesing that field before your bpm triggers? What form/method are you putting your code on?




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

I need to access data that was written to the CallContextBPM.Character01 field in C#

 

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();
  MessageBox.Show(edvts);

 

However it is always showing empty.

 

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

 

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

 

Anyone have any ideas on how to do this?

CallContextBpmData is supposed to  be ubiquitous (for a given screen) so that any call you make within the same screen should carry it.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

E: jose@…

http://www.josecgomez.com
     Â


Quis custodiet ipsos custodes?


On Fri, Nov 15, 2013 at 9:30 AM, <livingstonmh@...> wrote:

Â
<div>
  
  
  <p></p><p>Ok after so research I think I figured out why I am not getting the data.</p><p> </p><p>From what I understand the CallContextBPMData is for specific. Is it possible that since I am using a data directive that I am writing to the wrong callcontext? I am calling the   TransferWorkBenchDataSet.GetByID method, so I am gussing that might be where it is pulling the callcontext data from. Does anyone know if it would be possible to change the Context data that I am writing to?<var></var></p>


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

If you see my response I posted the code. It is on a customized replenishment workbench form.

Â

I know that the  MessageBox.Show(string.Concat("Orders Created\n",Orders)); only displays at the end, so I put the code at the end of the private void CreateOrder(Infragistics.Win.UltraWinGrid.UltraGridRow row).



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

Since your c# code is in a customization, maybe you're accesing that field before your bpm triggers? What form/method are you putting your code on?




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

I need to access data that was written to the CallContextBPM.Character01 field in C#

Â

I am using the below now:

  EpiDataView edvt = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
  string edvts = edvt.dataView[edvt.Row]["Character01"].ToString();

  MessageBox.Show(edvts);

Â

However it is always showing empty.

Â

I have attached a datadirective bpm to TFOrdDtl and when the TFOrdNum field is set I then set this BPM data field to the TFOrdNum. After this runs I need to access it in the C# program.

Â

This is basically a customization to the Transfer Order Workbench where when transfer orders are created I want to record the first order's number, and then set all orders created after that to the same number. Since this TFOrdNum is not available when this procress is run I had to use the TFOrdDtl datadirective to set a bpm field for the first one, and then I can use another BPM to set everything after that to the same thing.

Â

Anyone have any ideas on how to do this?

</div>
 


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