How add bound object/data binding on custom field so the value get inserted during save?

SOLVED

Hi all,

on SalesReceiptForm, I added a new custom field "BankDate" and I assume I shall add the field to SLPostedCustomerTran table as extension (SLPostedCustomerTranX: column BankDate; data type datetime). 

Then I see that this form is using Sage.Accounting.SalesLedger.SalesBankReceiptInstrument as boundObject, and I do not have clear vision of what table that it is using to store data and which table I should extend to add my custom BankDate columns.

After I insert value and Save, the values (except my BankDate value) inserted is in 3 different tables: SLPostedCustomerTran, CBPostedAccountTran, and SYSAuditTrail tables, by checking according to Reference and SecondReference.

My other observation is, afterClick saveButton/saveAllocationButton, I am not able to get the saved value as the form is refreshed immediately. 

In summary, my questions are:

1. I should extend which table to add my custom column "BankDate"?

2. At which point can I get the saved data, so I can get any unique ID to process insert my BankDate value?

3. Since I am going to extend standard table, can I use the boundObject to automate insert? (if that is how boundObject works)

Thank you. 

  • +1
    verified answer

    1. you need to decide where you want the BankDate to be stored, depending on what you want to use it for. But it may be CBPostedAccountTran rather than SLPostedCustomerTran. 

    2. Use Form.EndSave, then look at the SalesBankReceiptInstrument bound object; this has properties ActualBankAccountEntryID, ActualPendingAccountEntry and  ActualPostedAccountEntry, which you can use to read and update the posted/pending SL or CB transaction.

    3. You won't be able to data bind your value to the SalesBankReceiptInstrument bound object as it's a TransientBusinessObject rather than a PersistentObject, so can't be extended via an ObjectStore addin.

    As an aside, if the BankDate is meant to be the date the transaction has on the bank statement, you'll have some fairly difficult work to do to make the Bank Reconciliation use it!

  • 0 in reply to Geoff Turner

    Thank you Geoff. For now the Bank Date is to display on few screens.