I have a user defined field in the APTran table (Bills and Adjustments screen). There are actually two fields, UsrAllocationID (Unbound field for use only on the grid) and UsrAllocationID which is stored in the APTran table to save the history of the allocation ID used on the line.
public class APTranExt : PXCacheExtension<PX.Objects.AP.APTran>
{
#region UsrAllocationID
>PXInt]
>PXUIField(DisplayName = "Allocation Code ID")]
>PXSelector(typeof(Search<ICAllocationCode.allocationID, Where<ICAllocationCode.active.IsEqual<True>>>),
typeof(ICAllocationCode.allocationCD),
typeof(ICAllocationCode.description),
SubstituteKey = typeof(ICAllocationCode.allocationCD),
DescriptionField = typeof(ICAllocationCode.description))]
public virtual int? UsrAllocationID { get; set; }
public abstract class usrAllocationID : PX.Data.BQL.BqlInt.Field<usrAllocationID> { }
#endregion
#region UsrAllocationIDUsed
>PXDBInt]
>PXUIField(DisplayName = "Allocation ID Used", Enabled = false)]
>PXDefault(typeof(Select<ICAllocationCode>), PersistingCheck = PXPersistingCheck.Nothing)]
>PXSelector(typeof(Search<ICAllocationCode.allocationID>),
typeof(ICAllocationCode.allocationCD),
typeof(ICAllocationCode.description),
SubstituteKey = typeof(ICAllocationCode.allocationCD),
DescriptionField = typeof(ICAllocationCode.description))]
public virtual int? UsrAllocationIDUsed { get; set; }
public abstract class usrAllocationIDUsed : PX.Data.BQL.BqlInt.Field<usrAllocationIDUsed> { }
#endregion
}
I want the Allocation ID Used column to be read only.
I set the Enabled = false in the DAC.
In the row template, I have the settings that I think should make this read only.
<px:PXSelector runat="server" ID="CstPXSelector1" DataField="UsrAllocationIDUsed" AllowEdit="True" Enabled="False" AllowAddNew="False" />
I’m not sure what else to try.
Thanks,
Joe