OnSO, no idea.
For performance, you don't really have options in a pure BOI script unless there is a index to set a browse filter. A UDF won't have that, but if you used something like CustomerPONo, you could avoid looping through the entire table.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
------------------------------
Original Message:
Sent: 10-23-2019 17:11
From: Brett Zimmerman
Subject: Delete PO automatically
Thanks, @Kevin Moyes!! In the past we've had problems with that method and the 'delete' was unsuccessful and threw errors, but we'll give it another whirl. Would love your further thoughts on the following if you have a chance:
Wondering if we'd run into a performance issue with this. The client's S/O Entry is rather large (13k+ records for the import routine to constantly churn thru as it looks for the applicable orders to delete) and therefore it's possible that could slow things down considerably even though we're planning to set the import to run automatically in the background (every 10 minutes). So there's a chance that could have a performance impact on other users in S/O Entry and/or elsewhere in Sage 100, as well as likely needing a given import to finish before it next runs (i.e. if a given import takes longer than 10 minutes to run); I suppose we have the option to potentially purge/archive a good portion of S/O Entry. Also, do you know if the 'On SO' bucket in inventory will be properly reflected when deleting sales orders in this manner?
------------------------------
- Brett
------------------------------
Original Message:
Sent: 10-21-2019 15:20
From: Kevin Moyes
Subject: Delete PO automatically
Quick thoughts: Header post-write script, take your UDF value and open a new business object to delete the old SO (exempting the new / current SO). Filter to a specific VI job, so you don't cause chaos.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
Original Message:
Sent: 10-21-2019 14:58
From: Brett Zimmerman
Subject: Delete PO automatically
Related to this thread, I have a similar situation in v2017 where we'd like the ability to delete certain sales orders during a VI import, because we need to re-import the ones that have changed in the client's custom/source system (we can't just change them in Sage 100, we can't just re-import because the changes will likely include line item changes, we're not importing sales order #). Is this feasible with Perform Logic / Scripting? Also, since we're using 'Next' for the sales order # during the import, the 'deletion' would be controlled via the UDF data/column in the import source file. So basically for that UDF data, we want the import to search all of S/O Entry (i.e. UDF field), and if found, delete that order. (@Alnoor Cassim, @David Speck II, @Kevin Moyes: re: your postings; and others of course)
------------------------------
- Brett
Original Message:
Sent: 05-15-2019 01:39
From: Alnoor Cassim
Subject: Delete PO automatically
Great share David. For some reason I had compartmentalized this info in the past as only applying to Job Execution and Job Completion but of course that's not true. Give me a few days as I'm going to tied up but I'll start a new thread and to the best of my knowledge explain the difference between ProvideX functions like:
- INVOKE (and its variations)
- SYS - one does cmd.exe /c the other cmd.exe /k
- SYSTEM_HELP (I call it an old friend. Ideal for popping open a log file in Notepad, a PDF in Acro Reader, things like that. Always runs from the CLIENT side even on Adv and Premium. It's the closest equivalent to WScript.Run in VBScript.
and calls to Windows functions like:
- SYZDLL;Shell_And_Wait (uses Sage's MasExt32.dll as a hook to Kernel32 and User32 calls to run o/s commands and keep dependent windows open)
- DLX() calls to Kernel32 functions such as CopyFileA (for copying files)
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email: alnoor@callforhelp.biz
Orange County, CA
Original Message:
Sent: 05-15-2019 00:52
From: David Speck II
Subject: Delete PO automatically
Alright, so here is a breakdown of how framework VI perform logic is handled.
If the logic starts with "*" (asterisk) then the logic will have the ProvideX SYS function called against it. This is similar to VBScript's Shell.Run method. See this link for more detail. https://manual.pvxplus.com/PXPLUS/functions/sys.htm
If the logic starts with a "~" (tilde) then the logic will be supplied as an argument to the called program "..\SOA\SYZDLL;SHELL_AND_WAIT" which is another way to execute a program. I'm not certain on the pros and cons between this and the SYS function (which is similar to the INVOKE directive) but perhaps @Alnoor Cassim can provide insight.
If the logic contains a "'" (apostrophe) then the logic is execute as a ProvideX statement. See the "Statement" section at this link for more detail. https://manual.pvxplus.com/PXPLUS/PxPlus%20User%20Guide/Language%20Elements/Directives,%20Statements%20and%20Programs/Overview.htm
If the logic doesn't meet any of the above criteria and it is not blank, then the logic will be "PERFORMED". See this link for more detail. https://manual.pvxplus.com/PXPLUS/directives/perform.htm
------------------------------
David Speck II
Tennessee Software Solutions
Original Message:
Sent: 05-14-2019 11:44
From: David Speck II
Subject: Delete PO automatically
@Alnoor Cassim, are you referring to my recent post on how to delete price code records with a VI import?
I found out that you could use a an "!" In the perform logic command to Execute a statement by looking a compiled VI import job with the basic providex ide. Saw how it looks for different characters in the perform value to do different actions.
When I get a chance, i'll post more in detail about the different actions it recognizes.
------------------------------
David Speck II
Tennessee Software Solutions
Original Message:
Sent: 05-13-2019 09:23
From: Kevin Moyes
Subject: Delete PO automatically
Create a UDF in the header table, and set a script to run column Post-Validate. Import the system date into that field as part of your job... but Alnoor's PL seems easier to set up.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
Original Message:
Sent: 05-11-2019 15:27
From: Kenny Daniel
Subject: Delete PO automatically
They do not keep deleted PO history so that's not a concern. @Kevin Moyes I'm still not sure what you mean by activate a script via a UDF. We can delete the whole PO or just the lines but how do I trigger it? Thanks for all your help.
---------------------------------
Kenny Daniel
Technoclarity, Inc.
Original Message:
Sent: 05-10-2019
From: Kevin Moyes
Subject: RE: Delete PO automatically
I was pondering PO History with this. I wonder if a script, (triggered by a header UDF for import date, column post validate?) to delete existing PO lines, might be better than deleting the entire PO. If something fails (like a Purchases Clearing issue on a line), it might at least clean up the rest.
------------------------------
Kevin Moyes
Technical Systems Analyst
Munjal White Consulting Co.
Toronto ON
Original Message:
Sent: 05-10-2019 16:36
From: Michelle Taylor
Subject: Delete PO automatically
Just keep in mind that with History enabled in PO to retain deleted entries, you can't reuse a deleted PO Number.
------------------------------
Michelle Taylor
ERP Team Manager, CS3 Technology
918-388-9772
Original Message:
Sent: 05-10-2019 16:15
From: Alnoor Cassim
Subject: Delete PO automatically
Hi Kenny - Since you know the PO Number, yes you can have Perform Logic run on the Job Execution (meaning Job Start) event that will delete the existing PO then the rest of the import will run where presumably you have ASSIGNed the same PO Number in the import job. I can post a sample if you like. The only issue will be if the PO can't be deleted for some reason (e.g. it's in a Rcpt of Goods / Invoice batch), errors would appears in the Job Log during the import. If that is relevant for you this could be worth checking out -
Email Alerts for VI
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email: alnoor@callforhelp.biz
Orange County, CA