Hi Everyone,
I’ve Created a new Extension DAC.in this DAC fields , I have to set the PXDefault values but, getting null reference error when inserting time.
can you please help me on this ,
How to insert the Default value in DB? .
this is my Extension DAC fields :-
#region WcID
[WorkCenterIDField(Enabled = false)]
[PXUIField(DisplayName = "Work Center", Enabled = false)]
[PXDefault(typeof(Search<AMProdOper.wcID,
Where<AMProdOper.orderType, Equal<Current<AMClockItem.orderType>>,
And<AMProdOper.prodOrdID, Equal<Current<AMClockItem.prodOrdID>>,
And<AMProdOper.operationID, Equal<Current<AMClockItem.operationID>>>>>>))]
[PXFormula(typeof(Default<AMClockItem.operationID>))]
[PXReferentialIntegrityCheck]
public abstract class wcID : PX.Data.BQL.BqlString.Field<wcID> { }
protected string _WcID;
public virtual string WcID
{
get
{
return this._WcID;
}
set
{
this._WcID = value;
}
}
#endregion
#region AllowMultiClockEntry
[PXDBBool]
[PXUIField(DisplayName = "Allow Clock Entry for Multiple Production Orders", Enabled = false, Visible = false)]
[PXDefault(typeof(Search<AMWCExt.allowMultiClockEntry,
Where<AMWC.wcID, Equal<Current<wcID>>>>))]
[PXFormula(typeof(Default<wcID>))]
[PXReferentialIntegrityCheck]
public abstract class allowMultiClockEntry : PX.Data.BQL.BqlBool.Field<allowMultiClockEntry> { }
protected bool? _AllowMultiClockEntry;
public virtual bool? AllowMultiClockEntry
{
get
{
return this._AllowMultiClockEntry;
}
set
{
this._AllowMultiClockEntry = value;
}
}
#endregion
#region LaborTimeSeconds
[PXDBInt]
[PXUIField(DisplayName = "Labor Time Seconds", Enabled = false, Visible = false)]
[PXDefault(0)]
public abstract class laborTimeSeconds : PX.Data.BQL.BqlInt.Field<laborTimeSeconds> { }
protected int? _LaborTimeSeconds;
public virtual int? LaborTimeSeconds
{
get
{
return this._LaborTimeSeconds;
}
set
{
this._LaborTimeSeconds = value;
}
}
#endregion
Best answer by Marco Villasenor
View original