Notifications
Announcements
No record found.
Hi all !
I have a requirement to make the Phone and E-mail field of the DirPartyQuickCreateForm mandatory.
I have tried this using these methods so far but no success:
Please help me to resolve this.
Hi Ax-User,
You could try creating a CoC on the form init method and make these fields mandatory on the form. However the data sources have validateWrite methods overridden to return true. So, we can create validation methods for these two fields in the same extension class.
[ExtensionOf(formStr(DirPartyQuickCreateForm))] final class DirPartyQuickCreateForm_Extension { public void init() { next init(); LogisticsElectronicAddressBusinessPhone_ds.object(fieldNum(LogisticsElectronicAddress, Locator)).mandatory(true); LogisticsElectronicAddressEmail_ds.object(fieldNum(LogisticsElectronicAddress, Locator)).mandatory(true); } public boolean checkPhone() { boolean ret = true; if (!LogisticsElectronicAddressBusinessPhone.Locator) { ret = checkFailed("Phone must be filled in."); } return ret; } public boolean checkEmail() { boolean ret = true; if (!LogisticsElectronicAddressEmail.Locator) { ret = checkFailed("Email must be filled in."); } return ret; } }
You can then create a CoC on validateWrite method of DirPartyEntity data source to call the methods written earlier.
[ExtensionOf(formDataSourceStr(DirPartyQuickCreateForm, DirPartyEntity))] final class DirPartyQuickCreateForm_DirPartyEntity_Extension { public boolean validateWrite() { boolean ret = next validateWrite(); ret = ret && element.checkPhone() && element.checkEmail(); return ret; } }
Hi Gunjan !
Thank you . I tried this and it is working now.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 659 Most Valuable Professional
André Arnaud de Cal... 533 Super User 2025 Season 2
Sohaib Cheema 289 User Group Leader