Access PO_ReceiptReturnMatRqByPO

How can I access the table object PO_ReceiptReturnMatRqByPO? I need to delete a record from this table which refers to a ghost receipt and locks my PO.

There isn't a file with _bus or _svc, so using NewObject returns "NewObject Error 90".

When I go to the folder C:\Sage\Sage 100 Standard\MAS90\PO, I can't see this table. It only exists inside the companies folder like "MAS_ABX".
Does anyone know?
  • There would not be any company specific data in the PO Program File you mention.  Almost all data is stored in the company folder MAS_XXX.  What exactly is the error you are receiving? 

  • in reply to StefanouM

    If I'm trying to do

    pvxObject.NewObject("PO_ReceiptReturnMatRqByPO_bus",session)
    I get the error

    "NewObject Error 90"

  • in reply to tamir david

    Oh sorry, your getting a scripting error?  I'm not the right person to help.  

  • If you get this error in the UI when trying to access the PO, and you know there is not really a receipt open for it, then you can edit the table in Data File Display and Maintenance utility to remove the orphaned record.

  • in reply to hyanaga

    In the UI I know how to do it, the question is How to do it in scripting

  • in reply to tamir david

    I don't think it is possible to do directly using BOI... with data access happening indirectly through other business objects.

    Find what's causing your ghost entry, fix that, and you'll avoid the problem record.

  • in reply to tamir david

    I agree with Kevin.  Also, I don't think it's good practice to do it with script.  It could cause issues if a record is removed that shouldn't be removed.  This should not occur often, and if it is, the there is another underlying issue to uncover.

  • in reply to hyanaga

    This is the scenario. I'm trying to create a record for Receipt of Invoice. The keys are OK and record is created (after SetKeys() ). Now I'm trying to set the other fields (comment, amount, lines etc.). In my flow, in case there was a problem setting a value (for example comment longer from 30 characters, or Item without a GL attached to it), I want to cancel the new record and to delete it. So I delete the record and then I use DropObject for the object itself of PO_receipt_bus.

    The problem is that after that, the PO is still locked, because there is the orphaned record in ReceiptreturnMatRqByPO so I want to delete it also. It happens to me in version 2018 and 2019, but not 2020 and above

  • in reply to tamir david

    Fix your code for deleting the incomplete transaction.  The record in that table is created when you start the transaction, and your strategy to cancel is bypassing the cleanup.

    Perhaps get the key, make sure there is enough data to save the to-be-deleted transaction, Write(), then Delete(TheKey). 

  • in reply to Kevin M

    Is there a difference between version 2018/2019 to 2020/above that this situation doesn't occur in the newer versions?