I am looking for some help with creating an updateable BAQ with plans to create an updateable dashboard. The BAQ itself works but two of the fields will not save.
I update the PORel.Date01 and PORel.Date02 fields but they do not save after I hit ‘update’ and then ‘get list’. I have tried various BPM’s but no luck.
I just ran the query with the PO.UpdateExt and checked tables I didn’t have originally checked. Things are starting to work. I am getting update not allowed because I’m not authorized and also not allowed because of being approved. Added myself as approved buyer and doing some more testing now.
So next question that I’m sure could be anticipated.
Is there an easy way to unapprove/approve a PO without having to navigate to the PO Entry screen. It defeats the purpose a little not being able to update the fields just in the table.
Thank you. Don’t spend too much time on though if you can’t find. Right clicking to go to PO entry to unapprove, make change in table and then approve isn’t bad at all.
I had some down time, so I looked at my old .p files. I do not have an unapproved/reapprove, but found a PORel advanced update that should be a start on doing this.
/* update PORel */
def var buyer as logical init false.
define variable InfoMsg as character init ''.
define variable Msg as character init ''.
For Each ttResults where ttResults.RowMod <> '' on error undo, next:
For each PORel where PORel.Company = cur-comp and PORel.SysRowID = ttResults.PORel_SysRowID exclusive-lock.
For first PurAgent where PurAgent.Company = cur-comp and PurAgent.BuyerID = dcd-userid.
If PurAgent.InActive = true then next.
Buyer = true.
End.
If Buyer = false then Do.
InfoMsg = "Only Buyers can update".
{lib/PublishInfoMsg.i &InfoMsg = InfoMsg}.
End.
If Buyer = true then
PORel.CheckBox01 = ttResults.PORel_CheckBox01.
PORel.DueDate = ttResults.PORel_DueDate.
PORel.PromiseDt = ttResults.PORel_PromiseDt.
End.
End.
Good afternoon. I am working on the unapprove/approve portion of this UBAQ.
The pre-processing Directive works and I can unapprove the PO and make my updates in the Base Processing. Any direction on how to get the Post-Processing PO Approving to work?
Post processing is after the update, so you won’t have changed any longer and you may not have a current record. I would use a routine like the .p I posted to lop thru them and reapprove. You may have to set something in the record to know which to reapprove.
did you try the .p to just set the Date fields without having to unapprove/approve?
Thank you very much. I went down a rabbit hole of trying un-approve and approve and got close but no success. I am fairly new to this type of coding but modified my UBAQ a little to add the SYSROWID and used your code with the fields I cared about and it works!! No worries about approving and unapproving.
Thank you very much!!!
I will post my results for others to look at if they want.