In CSI/SyteLine 9.01.01, I'm trying to modify the way the Buyer is filled in Purchase Orders.
When a PO is created, the default Buyer should now be USERNAME() to take the PO creator's username.
The default behavior which I'm trying to replace is to get the Vendor's "buyer" field.
I'm not sure what is the proper way to do this...
I tried deleting the Binding (originally is object.Buyer) and writing USERNAME() in the Default Value field, but this creates 2 issues:
1. The buyer is now the current username on ALL POs
2. When changed, this field does not appear to have an Unsaved Modification (no orange square icon on the row number) ; I now understand that I have to keep the binding.
If I leave the Binding and use Default Value = USERNAME() then as soon as a Vendor is chosen, the current username is replaced by the Vendor's buyer, in the PO's BuyerEdit/BuyerGridCol fields.
I also tried to add an Event Handler on StdFormNew or StdObjectNew that assigns USERNAME() to BuyerEdit and BuyerGridCol, but same behavior.
So I want to remove the code that fetches the Vendor's Buyer when a new Vendor is chosen for the PO; but I cannot find where this is done...?