Skip mandatory field Validation in D365

HI all

I have a custom field in SalesTable (Field1) in which mandatory property is set to true. When I create a Sales Order from customer form a warning message is displayed(Field1 must be filled in). My requirement is I can’t make field1 mandatory to false and at the sametime I need to clear warning message.

Can someone help me to achieve this?

table_ds.object(fieldnum(table,field1)).mandatory(false); write this code in vaidate write method data source off the table

If the field is mandatory at table-level, you can’t make it optional from code. Why you “can’t make field1 mandatory to false” when it’s “a custom field”.

By the way, putting SreeKumarReddy’s code to validateWrite() would make little sense. Such things should be done during initialization, not during validation.

Hi sreeKumar

Are you saying I need to write this code in data source of the form.?