On occasion, users make mistakes and rather than allowing Sage to assign the next number, the users enters some text.
Can I go in to the DB and edit these fields?
OEORDH.ORDNUMBER
OESHIH.SHINUMBER
OEINVH.INVNUMBER
POPORH1.PONUMBER
On occasion, users make mistakes and rather than allowing Sage to assign the next number, the users enters some text.
Can I go in to the DB and edit these fields?
OEORDH.ORDNUMBER
OESHIH.SHINUMBER
OEINVH.INVNUMBER
POPORH1.PONUMBER
While you can... don't.
Those field values show up in more tables than just those. For example, we needed to do a renumbering process and to change the order number field we had 11 tables to update. And for Invoice numbers we updated 17-18 tables.
For one of my clients who has Extender, we've added business logic that says you can only enter an existing document number or *** NEW ***. No more documents with weird characters.
if a user accidently overrides the *** NEW ***, it will NOT work if they just type that in again. we had a few people try to be smart and then we had an order with it.
I'd be interested in how you used extender to stop the change. That's a good idea.
I chopped out a bunch of other logic so there might be a bug or two in this but this is a screen script that will only allow the user to enter *** NEW *** or an existing invoice number - otherwise an error message is thrown back at the user.
# OE1900 from accpac import * vInvoiceHeader = None def main(args): MyUI() class MyUI(UI): def __init__(self): UI.__init__(self) self.createScreen() def createScreen(self): global vInvoiceHeader vInvoiceHeader = openView("OE0420") self.dsH = self.openDataSource("dsOEINVH") self.dsH.onBefore = self.dsH_onBefore self.show() def dsH_onBefore(self, eventname, field, value): if eventname == "PUT": if field == "INVNUMBER": if self.isValidInvoiceValue(value) == True: return Continue else: error("Invoice not found.") return False def isValidInvoiceValue(self, docNumber): if docNumber == "*** NEW ***": return True vInvoiceHeader.order(6) vInvoiceHeader.put("INVNUMBER", docNumber) if vInvoiceHeader.read() == 0: return True else: return False
interesting, thanks for sharing. We have extender as part of a package but never really messed with stuff like this because we weren't sure if it was going to be a system drag at all across 100+ users. I'm going to dig into because users are constantly overriding the NEW field.
*Community Hub is the new name for Sage City