On Tue, Sep 29, 2015 at 12:05 PM, jdtrent@... [vantage] <vantage@yahoogroups.com> wrote:Â<div> <p>I tried this condition in the BPM Pre-Processing Directive:</p><div><br></div><div>Condition:</div><div>The ttPartPlant.QtyBearing field of the changed row is not equal to the ttPart.QtyBearing expression</div><div><br></div><div>Save result:</div><div><br></div><div><span class="ygrps-yiv-1737804136"><div>There is at least one compilation error.</div><div><br></div></span><div>Exception caught in: Epicor.ServiceModel</div><div><br></div><div>Error Detail </div><div>============</div><span class="ygrps-yiv-1737804136"><div>Description:  There is at least one compilation error.</div><div>Details:  </div></span><div>Error CS0136: A local variable named 'ttPartRow' cannot be declared in this scope because it would give a different meaning to 'ttPartRow', which is already used in a 'child' scope to denote something else [Part.Update.cs(663,17)]</div><div>Program:  Epicor.Customization.dll</div><div>Method:  PrepareException</div><div><br></div><div>It gave me a similar message if I reversed the fields.</div><div><br></div><div>Thanks,</div><div><br></div><div>Joe</div></div><div><br></div><p></p> </div> <div style="color:#fff;min-height:0;"></div>
Hi,
I'm trying to create a method directive BPM with custom code that forces the PartPlant QtyBearing field to match the Part QtyBearing field. If I try a test like:
bool NQBMismatch = false;
if (ttPartPlant.QtyBearing == true) {NQBMismatch = true;}
return NQBMismatch;
On save, I get the error:
Description: There is at least one compilation error.Details: Error CS1061: 'Erp.Tablesets.PartPlantTable' does not contain a definition for 'QtyBearing' and no extension method 'QtyBearing' accepting a first argument of type 'Erp.Tablesets.PartPlantTable' could be found
I can read ttPartPlant for the record as:
var ttPartPlantResult = (from row in ttPartPlant where row.Company == Session.CompanyID select new { row.PartNum, row.QtyBearing}).FirstOrDefault();
It looks like I get the original row, and not the changed row I trying to save.
How can I access fields from the current changed row in BPM custom code?
Thanks,
Joe
--
Joe D. Trent
Bigham Ag Equipment
Try this to get the updated or added row for PartPlant.
var ttPartPlant_xRow = (from ttPartPlant_Row in ttPartPlant
where (((string.Equals(ttPartPlant_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase)) || (string.Equals(ttPartPlant_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase)))
select ttShipDtl_Row).FirstOrDefault();
My Parenthesis might be off, but that statement will get you the updated or added row.
Good luck
Once done, you will reference fields like this...
ttPartPlant_xRow["Checkbox02"] = false.
Etc....
On Mon, Sep 28, 2015 at 3:33 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:Â<div> <p></p><p>Once done, you will reference fields like this...</p><p><br></p><p>ttPartPlant_xRow["Checkbox02"] = false.</p><p>Etc....<br></p><p></p> </div> <div style="color:#fff;min-height:0;"></div>
On Mon, Sep 28, 2015 at 4:06 PM, amathis@... [vantage] <vantage@yahoogroups.com> wrote:Â<div> <p>I am curious though, you could probably do this without the custom code and just condition statements, and then use a throw exception balloon, but whatever works :)</p> </div><span class="ygrps-yiv-1686759964"> <div style="color:#fff;min-height:0;"></div>