UBAQ Cannot Set Column

Trying to create an Updatable BAQ on erp.VendPart to add Vendor Pricing.
I have created the basic uBAQ, Dashboard and menu item.
I can change and save existing data in the grid, but when I hit the ‘New’ button to try to add a new record I get and Application Error Pop up: Exception caught in: System Data.

It looks like it is not happy with VendPart_EffectiveDate when trying to initialize a new row.
I went back to the uBAQ and under the UpdateTab/GeneralProperties… I set the ‘Initital Expression’ for VendPart_EffectiveDate to Constants.Today… but this did not do the trick.

Any hints are much appreciated.

Application Error

Exception caught in: System.Data

Error Detail

Message: Cannot set Column ‘VendPart_EffectiveDate’ to be null. Please use DBNull instead.
Program: System.Data.dll
Method: set_Item

Client Stack Trace

at System.Data.DataRow.set_Item(DataColumn column, Object value)
at Ice.Lib.Framework.BAQDataView.applyGetNewSubscribers(DataRow newRow)
at Ice.Lib.Framework.BAQUpdater.GetNewBAQRow(BAQDataView BAQView, Object[]& ItemArray)
at Ice.Lib.Framework.BAQUpdater.AddNewBAQRow(BAQDataView BAQView)
at Ice.Lib.Framework.BAQDataView.HandleAppControlEvent(AppController AppController, AppControlEvent AppEvent)
at Ice.Lib.Framework.UIApp.AppController.HandleBaqGetNew()
at Ice.UI.App.SupplierPriceListUpd.MainController.HandleAdapterGetNew()
at Ice.Lib.Framework.UIApp.AppController.OnGetNew(String GetNewText)
at Ice.Lib.Framework.UIApp.AppControllerPanel.OnClickNew(String ViewName)
at Ice.Lib.Framework.UIApp.AppControllerPanel.HandleToolClick(String tKey, ToolClickEventArgs ea)
at Ice.Lib.Framework.UIApp.EpiHostForm.EpiHostForm_BeforeToolClick(Object sender, BeforeToolClickEventArgs e)
at Ice.Lib.Framework.EpiBaseForm.OnBeforeToolClick(String tKey, ToolClickEventArgs ea)
at Ice.Lib.Framework.EpiBaseForm.handleToolClick(String tKey, ToolClickEventArgs ea)

What happens if you try: DBNull.Value

You could potentially handle this in your BAQ’s GetNew method and set the defaults.

Thanks for the hints.

I tried DBNull.Value in the "Initial Expression’ but the system will not allow to save the BAQ:

Problems in BAQ update processing
Initial expression for ‘EffectiveDate’ field is invalid: Result of expression cannot be assigned to variable of ‘System.DateTime?’ type

Unable to save updatable BAQ
See ‘Problems in BAQ update processing’ section for details.
Uncheck updatable flag on general tab to save updatable BAQ.

I also to a stab at adding a pre-processing method in the BPM Directive Configuration.
I am not 100% sure if I am doing this correctly, but with the method saved and enabled I am still seeing the original error. I know the method is firing b/c I placed a pop-up in there. The pop-up shows before the error, so I thought pre-processing may have been the right spot to try and set the date.

Again… thanks for the hints.

For the case of the GetNew, I think I’d set the value in the Post Process

Thanks Chris, but same result.

Still searching on the error… not sure if has something to do with getting the date format to text, but some of the help sites are alluding to something along those lines when I search on the DBNull error.

Can I have a copy of this BAQ for my own research?