Can anyone help me how to update the table field properties in D365 FO using x++ code.
You can't use X++ to change table definitions.
If you explain your business requirement, we should be able to suggest a technical solution which (unlike this one) can be done.
we have list of label ids in excel, Instead of updating the label id manually , we planned to update it by x++ code or by any mode.
You're still describing your own technical design, which is wrong and can't be implemented. Forget it and tell about us the business problem, i.e. the problem that users need solve. Implementation details of your solution are not relevant, if the whole solution doesn't make sense.
Labels are defined at design-time in Visual Studio, not inside the ERP GUI. If needed, you can develop a Visual Stuido add-on for your purposes. If your business problem requires changes at runtime, you will need a completely different approach than trying to change application object definitions.
Thanks for your valuable reply. Thought of updating it from excel for the existing objects doesn't have the labels.
Then you should indeed do it at development time, not at runtime in X++. You'll change labels in application matadata, build the application, create a deployable package and deploy the compiled solution to test environments and ultimately (after successful testing) to production. You won't change the application in at runtime in production.
You should start by defining how you'll define labels and their targets in an Excel file. For example, you need to define the label file, label ID, texts in all required languages and all the target objects and target properties (which may be tricky in certain cases). To be honest, it sounds like more work then doing it directly in Visual Studio, but that's your choice...