PO Detail Comment Text - Approved PO's

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

Thanks for posting this Dan. It has helped me get a working updatable dashboard to change the promise or due date on the header level and release level by unapproving and reapproving behind the scenes. You state in the pdf that you could use GetBy to refresh the results. What do you mean by this? I attempted to add another Invoke BO method widget with the PO.GetByID with the poNum binded to the ttResultsRow.POHeader_PONum and the PO table set output is ignored. This does not work to refresh as I am sure I have not set it up correctly. Could you expand on this?

Sorry for bringing up an old topic, but the help would be greatly appreciated.

Sure - I can add this in a little bit.

I added an example in this post uBAQ not updating PO.DocUnitCost

There are also examples of handling this within the Dashboard on this site you should be able to search and find.

What is the code for the DefaultImpl1 look like.
What are the Invoke BO Method parameters?

Thanks
David

it is exactly as what Dan posted here

1 Like

Thanks! This works great

1 Like