Last active
February 23, 2022 01:57
-
-
Save vxzry/daabb02a7417a4ee27fecb6a66acadc3 to your computer and use it in GitHub Desktop.
D365 F&O: Set form datasource fields as mandatory via extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ExtensionOf(formStr(VendTable))] | |
final class VendTableAVG_Extension | |
{ | |
void init() | |
{ | |
next init(); | |
this.setMandatoryFields(); | |
} | |
void setMandatoryFields() | |
{ | |
FormDataSource dataSource = VendTable_ds; | |
// Buyer group | |
dataSource.object(fieldName2id(dataSource.table(), | |
formDataFieldStr(VendTable, VendTable, ItemBuyerGroupId))) | |
.mandatory(true); | |
// Other Option | |
// Segment | |
dataSource.object(fieldNum(VendTable, SegmentId)).mandatory(true); | |
// Terms of payment | |
dataSource.object(fieldNum(VendTable, PaymTermId)).mandatory(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment