PO Detail Comment Text - Approved PO's

Hi,

The purchasing team want to be able to add comments against PO lines via a nightly DMT script, using the ‘POCombined’. (they log all their notes on a spreadsheet during the day)

It works fine or the unapproved PO’s, however, I need a way of unapproving the PO to allow the edit and then reapproving it, once the update has completed.

I tried creating a boolean custom field against the PODetail called 'ReApprove_c that I hoped I could use it in a post processing method directive, but it didn’t work.

At the moment the only thing I can think of is to use a UD table, but that really is a last resort.

Has anyone any other ideas.

Cheers,

Andrew.

Hi Andrew,

How about multiple DMT files/runs? Unapprove, make comments, reapprove, using 2 or 3 DMT files.

Nancy

1 Like

Hi Nancy,

This is an option and as it stands the best.

I’ll have to do some scripting in Powershell, to create the ‘Approve’ version, as purchasing will only maintain the version with the notes.

Your suggestion does have the advantage of keeping everything clean and isolated from the Epicor approval function.

Thanks,

Andrew.

1 Like

Are these notes that need to appear on the printed PO, or just notes for internal use (like, “Called Bob to see if he could move it up 2 days, and he said yes.”)?

Would Memos work better?

Also, updating the comments with DMT risks overwriting any comments entered manually through the UI.

Is the Excel file used for anything else? If not, think about making an updatable dashboard that they could leave open, and just update the comments in it, instead of to an external Excel file.

1 Like

Hi Calvin,

The spreadsheet is used for efficiencies sake. I have tried the argument re using the system as point of entry, but that is not an option.

The updateable dashboard would work, but it still would not get around the approval issue.

Memo’s are an option, but they are considered too cumbersome by the team and also I cannot find a DMT upload for memos, just memo types.

The script is coming on well and I’ll post it when I have got it working

2 Likes

I assume you don’t have purchasing limits. Because if you unaprrove a PO, that originally need approval, you might not be able to just re-approve it. It might have to go through the the user that approved it. You could get around this in DMT by using the approvers login credentials for the DMT command line. But if you have more than one approval person, you’d need to run separate DMT inputs for each.

You can use an updateable dashboard. The UBAQ looks something like this - just added widgets to BASE - to handle unapproving and approving. The user just modifies the CommentText field when editing. You could do the same with DMT if you wanted. Most the requests I do for this use a dashboard for this with this type of UBAQ behind it.

2 Likes

Hi @danbedwards,
have you actually done it and worked for you ?, because i have tried this idea and could not bypass the approve flag at all, even with invoking the changeApproveflag method

Yes - works great.

any chance to share your uBAQ ?

Absolutely. This is 10.2.300 but I have similar back to 10.1.400 and up to 10.2.400.
UpdatePOComments.baq (51.6 KB)

3 Likes

thanks, but can not see your modified advanced BPM workflow


Because I modify the base the custom logic does drop on import sometimes. There is a way around this. For now, you can add Set Field widget and do the following with 3 on each side of the Base.
Before Base
1 - Set Approve = false
2 - Set ApprovalStatus = “U”
3 - Set ReadyToPrint = false
After Base
Do the opposite of above.

1 Like

this work beautifully, many thanks mate, really appreciate your valuable tips pal, it is priceless

1 Like

Here’s the powershell script.

<#
.SYNOPSIS
Add comments to unapproved and approved Purchase Order Details csv file
.DESCRIPTION
The script loads the csv file using DMT.

Any errors are put into the error file.

The error file is used to generate a csv file with the approve flag set to false

The file is then loaded.

Finally, the error file is used to generate a csv file with the approve flag set to true, to return the records to there original approval status

.INPUTS
None
.OUTPUTS
None
.NOTES
Version: 1.0
Author: Andrew Clements - Cobra Consulting Limited
Creation Date: 30/10/2019
Purpose/Change: Initial script development

.DISCLAIMER
THIS SAMPLE CODE ON “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL COBRA CONSULTING LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY,
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY WAY OUT OF THE USE OF THIS SAMPLE CODE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

.
#>

#----------------------------------------------------------[Declarations]----------------------------------------------------------

$DMTPath = “C:\Epicor\ERP10.1Client\Client\DMT.exe”
$User = ???
$Pass = ???
$Env = "net.tcp://???”
$DMTLoad = “PO Combined”
$Config = “EpicorERPTest”

$Source = “C:\temp\PODetailNotes.csv”
$Log = “C:\temp\PODetailNotes.log”
$completeLog = “C:\temp\PODetailNotes_CompleteLog.txt”
$errorLog = “C:\temp\PODetailNotes.csv.Errors.Reprocess.csv”
$unapprove = “C:\temp\unApprove.csv”
$approve = “C:\temp\Approve.csv”
$approveTmp = “C:\temp\ApproveTmp.csv”

#-----------------------------------------------------------[Functions]------------------------------------------------------------

load Data $
Start-Process -Wait -FilePath $DMTPath -ArgumentList “-ConnectionUrl $Env -User $User -Pass $Pass -Add=false -Update=true -Import ““PO Combined”” -Source $Source -NoUI -ConfigValue $Config -logfile $Log”

create the unapprove file based on the records in the errorfile generated by DMT, adding the appove column set to false

Import-Csv $errorlog |
Select-Object *,@{Name=‘Approve’;Expression={‘false’}} |
Export-Csv $unApprove -NoTypeInformation

load the unapprove records
Start-Process -Wait -FilePath $DMTPath -ArgumentList “-ConnectionUrl $Env -User $User -Pass $Pass -Add=false -Update=true -Import ““PO Combined”” -Source $unApprove -NoUI -ConfigValue $Config -logfile $Log”

create a temporary unapprove file based on the records in the errorfile generated by DMT, removing all but the first two columns

(Import-CSV $errorlog -Header 1,2,3,4,5,6,7,8 |
Select “1”,“2” |
ConvertTo-Csv -NoTypeInformation |
Select-Object -Skip 1) -replace ‘"’ | Set-Content $approveTmp

#create the file to reapprove the records that were unapproved, adding the approve column set to true
Import-Csv $approveTmp |
Select-Object *,@{Name=‘Approve’;Expression={‘true’}} |
Export-Csv $approve -NoTypeInformation

load the reapprove column
Start-Process -Wait -FilePath $DMTPath -ArgumentList “-ConnectionUrl $Env -User $User -Pass $Pass -Add=false -Update=true -Import ““PO Combined”” -Source $approve -NoUI -ConfigValue $Config -logfile $Log”

2 Likes

Hi @danbedwards
just noticed that PO does not re approved after this update, any idea ?

Is the user running the update-able dashboard setup as a buyer with an unlimited limit? If not then the controls to prevent someone from approving a PO that exceeds their buying limt, may be working against you.

Use this - there are two flavors of this multiple rows and single row. This is the single row and for multiple you put the code inline in the default widget.POUpdate.pdf (842.5 KB)

1 Like

thanks for your feedback @ckrusen, i agree, but i am trying to update my PO and i have no limit restrictions, beside i would expect the exception message to say that, if it is the case.

Hi @danbedwards,
appreciate your support mate, your technical document is crystal clear and i have done it exactly as per your design, but still no luck