How to use UpdateTableBuffer in E10, or the new way

Well shame on the example saying I should lol. Thank you.

In progress we had code that would change a row in the database. Here is an example:


Run lib\UpdateTableBuffer.p(input Buffer PartLot:HANDLE, "LotLaborCost", vLbrCost).


Now I am aware that does not exist like that in E10, but does anyone know how to do this in a BPM in the C#/E10 way? I would greatly appreciate any help. Also when using the Progress 4GL to C#, it converted that line to this:


Services.Lib.UpdateTableBuffer._UpdateTableBuffer(PartLot, "LotLaborCost", vLbrCost);


where I get the error:


Error CS0103: The name 'Services' does not exist in the current context 


Thanks in advance for any advice!

You just assign the value to the variableÂ
x.Comment ="My new thing"
Look at the programmers reference guide, but there is not such a thing as updata table buffer. IN E10 you look up the Record in (Db) and then assign to the column the value.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Apr 15, 2015 at 11:22 AM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p><span></span></p><p>In progress we had code that would change a row in the database. Here is an example:</p><p><br></p><p>Run lib&#92;UpdateTableBuffer.p(input Buffer PartLot:HANDLE, &quot;LotLaborCost&quot;, vLbrCost).</p><p><br></p><p>Now I am aware that does not exist like that in E10, but does anyone know how to do this in a BPM in the C#/E10 way? I would greatly appreciate any help. Also when using the Progress 4GL to C#, it converted that line to this:</p><p><br></p><p>Services.Lib.UpdateTableBuffer._UpdateTableBuffer(PartLot, &quot;LotLaborCost&quot;, vLbrCost);</p><p><br></p><p>where I get the error: </p><font size="1"><p><br></p><p>Error CS0103: The name &#39;Services&#39; does not exist in the current context </p><p><br></p><p><font size="2">Thanks in advance for any advice!</font></p></font><p></p>

</div>
 


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

Ok, so I have this code.


PartLot = (from PartLot_Row in Db.PartLot
                   where (PartLot_Row.Company == Session.CompanyID) && ((PartLot_Row.PartNum == ttInvTrans_xRow.PartNum) && (PartLot_Row.LotNum == ttInvTrans_xRow.FromLotNumber))
                   select PartLot_Row).FirstOrDefault();
        if (PartLot != null)
        {

               assign PartLot.ShortChar01 = "Something"

        }


Like that?


or how would I do this?

You wouldn't use assign that's not valid C# but that's the general idea. Look at the programmers Guide Page 33


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Apr 15, 2015 at 11:40 AM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p>Ok, so I have this code.</p><p><br></p><p>PartLot = (from PartLot_Row in Db.PartLot<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  where (PartLot_Row.Company == Session.CompanyID) &amp;&amp; ((PartLot_Row.PartNum == ttInvTrans_xRow.PartNum) &amp;&amp; (PartLot_Row.LotNum == ttInvTrans_xRow.FromLotNumber))<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  select PartLot_Row).FirstOrDefault();<br>Â Â Â Â Â Â Â  if (PartLot != null)<br>Â Â Â Â Â Â Â  {</p><p>Â Â Â Â Â Â Â Â Â Â Â Â Â Â  assign PartLot.ShortChar01 = &quot;Something&quot;</p><p>Â Â Â Â Â Â Â  }</p><p><br></p><p>Like that?</p><p><br></p><p>or how would I do this?<br></p><p></p>

</div><span class="ygrps-yiv-1791411966">
 


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


I thought I downloaded all the guides for E10, but don't seem to have one called programmers guide. Did you get that from the EpicWeb Site?
I downloaded all the epicor guids, but I don't see a programmers guide. That might of been useful. Do I get that from the EpicWeb Site?
Nevermind, once again Jose, thank you for everything!


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Apr 15, 2015 at 12:05 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>I downloaded all the epicor guids, but I don&#39;t see a programmers guide. That might of been useful. Do I get that from the EpicWeb Site?</p>

</div><span class="ygrps-yiv-1792421829">
 


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


Jose one more question. So following the example I have this so far:


var OrderDtl_UD = (from OrderDtl_Row_UD in Db.OrderDtl_UD.With(LockHint.UpdLock)
               where OrderDtl.SysRowID == OrderDtl_Row_UD.ForeignSysRowID &&
               OrderDtl.Company == Session.CompanyID
               select OrderDtl_Row_UD).FirstOrDefault();


            OrderDtl_UD.ShortChar02 = ttQuoteDtlRow.UDField<System.String>("ShortChar02");
            OrderDtl_UD.Number02 = (decimal)ttQuoteDtlRow.UDField<System.String>("Number02");
      Db.Validate();


however, my issue is this, I get this error message:


Error CS1061: 'Erp.ErpContext' does not contain a definition for 'OrderDtl_UD' and no extension method 'OrderDtl_UD' accepting a first argument of type 'Erp.ErpContext' could be found (are you missing a using directive or an assembly reference?) [Quote.CreateOrder.cs(449,53)]


any ideas?

You should not be using Table_UD directly your custom field is in the original table.OrderDtl


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Wed, Apr 15, 2015 at 4:51 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p></p><p>Jose one more question. So following the example I have this so far:</p><p><br></p><p>var OrderDtl_UD = (from OrderDtl_Row_UD in Db.OrderDtl_UD.With(LockHint.UpdLock)<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â where OrderDtl.SysRowID == OrderDtl_Row_UD.ForeignSysRowID &amp;&amp;<br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â OrderDtl.Company == Session.CompanyID <br>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â select OrderDtl_Row_UD).FirstOrDefault();</p><p><br>Â Â Â Â Â Â Â Â Â Â Â  OrderDtl_UD.ShortChar02 = ttQuoteDtlRow.UDField&lt;System.String&gt;(&quot;ShortChar02&quot;);<br>Â Â Â Â Â Â Â Â Â Â Â  OrderDtl_UD.Number02 = (decimal)ttQuoteDtlRow.UDField&lt;System.String&gt;(&quot;Number02&quot;);<br>Â Â Â Â Â Â Db.Validate();</p><p><br></p><p>however, my issue is this, I get this error message: </p><font size="1"><p><br></p><p>Error CS1061: &#39;Erp.ErpContext&#39; does not contain a definition for &#39;OrderDtl_UD&#39; and no extension method &#39;OrderDtl_UD&#39; accepting a first argument of type &#39;Erp.ErpContext&#39; could be found (are you missing a using directive or an assembly reference?) [Quote.CreateOrder.cs(449,53)]</p><p><br></p></font><p>any ideas?<br></p><p></p>

</div><span class="ygrps-yiv-1451545208">
 


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