Hello all,
How would I go about changing the default value in the customization project for a specific field on a form?
I though it would be under this section, but I haven’t had any luck so far.
Hello all,
How would I go about changing the default value in the customization project for a specific field on a form?
I though it would be under this section, but I haven’t had any luck so far.
Best answer by Hughes Beausejour
Override the target field and change PXDefault attribute:
#region CaseClassID
public abstract class caseClassID : PX.Data.BQL.BqlString.Field<caseClassID> { }
[PXDBString(10, IsUnicode = true, InputMask = ">aaaaaaaaaa")]
[PXDefault(typeof(Search<CRSetup.defaultCaseClassID>))]
[PXUIField(DisplayName = "Class ID")]
[PXSelector(typeof(CRCaseClass.caseClassID),
DescriptionField = typeof(CRCaseClass.description),
CacheGlobal = true)]
[PXMassUpdatableField]
public virtual String CaseClassID { get; set; }
#endregion
Or create a graph extension, then use FieldDefaulting event and NewValue property:
public class CRCaseMaintExt : PXGraphExtension<PX.Objects.CR.CRCaseMaint>
{
public virtual void CRCase_CaseClassID_FieldDefaulting(PXCache sender, PXFieldDefaultingEventArgs e)
{
e.NewValue = "DefaultValue";
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.