I think you’re asking if DMT just updates the DB fields based on your supplied file.
The answer is “kind of”. It doesn’t just update DB tables directly. DMT calls the Business Objects that normally run in the client when changes are made via the client, using the info in your file. By calling the BO, additional checks and actions occur. Here’s a few examples:
Closing an Sales Order Header (by setting the OpenOrder column to FALSE) does end up setting OrderHed.OpenOrder to false. But it will also close any open lines and releases. Just like if you selected “Close Order” in Order Entry.
Trying to change a PO Line on a PO marked Approved. Just like you cannot change the line of an Approved PO in PO entry, DMT cannot do that either. You would have to do it in three steps.
Un-Approve the PO
Update the PO Line
Re-Approve the PO
The above could be done as 3 DMT uploads, or possibly as a single DMT using the “PO Combined” DMT object. The method using “PO combined” would require three rows One for each of the actions mentioned above.
Here’s an example of changing the Qty of line 1 of Approved PO 1234, from 5 to 10.
(note that it wouldn’t actually work as other fields are probably required)
Company PONum VendorVendID Approve PODetail#POLine PODetail#BaseQty
MC 1234 ACME FALSE 1 5
MC 1234 ACME FALSE 1 10
MC 1234 ACME TRUE 1 10
The first two lines might be able to be combined, but I prefer to do things one step at a time.
I have done some work on the Change Log. I have it to where it shows most of the data I’m after. The issue I’m having is with previous part number on the OrderRel table. When I upload the data change for part number it shows the change on the part number, but Previous Part Number is still blank. Does this populate from a different area from OrderDtl Partnum or OrderRel Partnum?
Additionally I would like some assistance getting previous entries in data tables to populate into UD tables.
Have you tried changing just the PartNum on the OrderDtl? It should flow through to the OrderRel.
Also, don’t just assume that a built-in field works a certain way. Have you confirmed that the OrderRel.PrevPartNum field is updated when you change the PartNum on the order line via the UI?
@ckrusen, I did that and I’m seeing a change same as you. I’m working on assigning previous entries into a UD field. instead. Do you have any tips on how to do this?
The ChangeLog (on the OrderDtl table) will capture it.
What do you need it for? If its for anything that’s automated, then the ChangeLog file has shortcomings, and is a pain to parse.
The most important thing to note about the changelog is that change log records are tied to table records. If that table record is deleted (like deleting a line or a release), the changes associated with that record are lost. For example:
New line (Line 2) added to an order.
Changelog contains manager 10:23:29 New Record
Line 2 P/N changed from CB-0001 to CB-0003
Changelog contains: manager 10:23:29 New Record manager 10:24:54 PartNum: CB-0001 -> CB-0003
Line 2 deleted
No change Log records exist
New line added, set P/N to CB-0003
Changelog contains manager 10:28:50 New Record
So from the change log it looks like CB-0003 was added as the “2nd line”, and no changes were made since the record was added.
We are wanting to make a report that shows what was updated through our scheduled DMT Upload and what the previous entries for each changed component were.
I think the simplest would be a DD on changes to the OrderDtl , that add records to a UD table. Use the OrderNum, OrderLine, OrderRel, and DateTime as key fields.
Whats a DD? Still trying to keep track of all the acronyms. Currently I’m trying to build a BPM workflow that sets the UD field ttOrderRel.PrevShipTo_c to ttOrderHedRow.ShiptoNum using preprocessing. However, the UD field is not receiving any information.
BPM’s come in two flavors DD’s (Data Directives), and MD’d (Method directives). But must people refer to the MD as a BPM.
DD’s - monitor the DB tables for new or changed records in the table. There are two types:
a. The In-Transaction (“In-Tran”) type fires before the table is updated.
b. The Standard type fires after the table has been updated.
MD’s (or “BPM’s”) - work on “Business Objects” (BO’s). The easy way to think of these is that they can be triggered when specific application functions happen. The BO for SalesOrder, has many functions that are called when the client program does various things. The function that is called is known as the “Method”.
For example, the BO SalesOrder , has a Method named ChangeDiscountPercent. When the Discount Percent is changed on an order, it is the function that is called to recalculate discounts.
MD’s have two types, Pre- and Post- Processing. One will ahppen before the builtin method happens, and the other after.
Updating info outside of the scope of the BPM (the db table in a DD, and the tables related to the BO in a MD) can be difficult.
DD’s are best for very simple things, like updating a tables UD field, on a new record creation or change. For example, say you have a UD field Created_c in a table, and wanted to set that field to the DateTime when the record is created.
MD’s are much better for complex actions that might span several tables. Like how a Sales order has Header, Detail and Release tables, and you might want to control something in the Header, when info on a release changes or meets some condition.
Ran into another problem with DMT. I need to be able to update ShipToNum. If I select ShipToNum and update it assigns the value to the OrderHed table and doesn’t trickle down to the OrderRel to populate the PrevShipToNum that I need for our report to compare against. If I go into Template builder and add in:
@hkeric.wci,
That seemed to do the trick! Thank you sir!
Next Section of the project is to schedule DMT. I’m currently looking into how to use Windows scheduler to run it, but I haven’t found anything that tells it where to look to files or how to do so. If anyone has so insight on how to I would greatly appreciate it.
I am currently following these two posts:
What I don’t understand is what is to go in the custom c# coding section. Does anyone know what is to be put there?
I use Windows Task Scheduler to run a DMT daily. But the windows task specifies a PowerShell(PS) script to run at a certain time each day.
You could make a PS script, that checks for the existence of a file and the if it exists, the call DMT via the command line, and then delete the file. This PS script could be scheduled to run every 5 minutes.
Looking for something like that?
edit
And here’s a lengthy topic on DMT and PowerShell
and FWIW - I struggled with how to use quotes in a string that is referenced by another string.