Data Directive Custom Code - E10 Newbie!

We are currently in the process of reviewing and updating any necessary customisations in V8 ready for an E10 implementation later this year. We currently have a BAM that sends an email when a Part Revision is approved. My questions are as follows:

  1. Due to the number of places a revision can be approved (Engineering Workbench - individual or all, Part Maintenance, etc) am I correct in using a Data Directive for this alert?

  2. I want to include the Part Description on the email and this is not available from the PartRev table - do I need to use the ā€˜Execute Custom Codeā€™ for this?

  3. I have made a start on the above assumptions but am new to C# and am getting the following:
    image

We have a few BPMā€™s and alerts that I have written in Progress so any tips or advice for someone just starting out would be greatly appreciated :slight_smile:

2 Likes

Thank you. Getting there :slight_smile:

Version:0.9 StartHTML:00000097 EndHTML:00002236 StartFragment:00000199 EndFragment:00002198 /* Link to Part table to include Part Description in email */

Ice.Diagnostics.Log.WriteEntry("BPM: PartRev.Update");

Erp.Tables.Part Part;
Ice.Diagnostics.Log.WriteEntry("BPM: PartRev.Update - Part Table added");

var ttPartRev_Row = ttPartRev.FirstOrDefault();
if (ttPartRev_Row !=null)
{
var Part_Recs = (from Part_Row in Db.Part
where Part_Row.Company == ttPartRev_Row.Company
&& Part_Row.PartNum == ttPartRev_Row.PartNum
select Part_Row).FirstOrDefault();
}
Ice.Diagnostics.Log.WriteEntry("BPM: PartRev.Update - PartRev.PartNum: " + ttPartRev_Row.PartNum);

Iā€™m wondering why you need custom code for this? (I donā€™t think you do) Have you tried simply using a condition, ā€œwhen field changes from false to trueā€? You should be able to catch any time a revision is approved, and you can send an e-mail from a widget too (as long as your e-mail system is set up correctly)

Edit: I missed the part about getting the description. Sorry.

I was off last week but wanted to provide an update for thisā€¦ I managed to get all the code working (although when I approved a Part via Part Maintenance instead of via the Engineering Workbench I got 2 emails instead of 1!). However, if use the Approve\Check In All via Engineering Workbench we only get an email for one part!

The idea behind using a Data Directive was that we will need at least 3 separate method directives (Part.Update, Check In and Check In All) but at least I have working code that I can hopefully transfer over! :slight_smile: