I have created a Table in AL Language (NAV 2018) ,but how to define option type field and CaptionML type properties. please anyone suggest me..
My I suggest NOT to use CaptionML. This is only used for compatibility purposes. Instead use Labels and translation file. CaptionML will be removed from AL.
But otherwise the best example is see the code generated by Txt2al.