CAL Programing

navuser1navuser1 Member Posts: 1,329
Hi All,

Maximum time we write functions in tables and call them, but it can be written in the codeunit also. How can I decide whether a function should be written in a table or codeunit ?



Plz reply!
Now or Never

Comments

  • pdjpdj Member Posts: 643
    Regards
    Peter
  • DenSterDenSter Member Posts: 8,304
    This is very subjective, and there is no one good answer. You will get different opinions from different people. For me, if it relates to one table, or even only when it relates to one record in a table, then I put the function in the table, so that you can call it from the record variable in other objects, like MyRecordVariable.SomeFunction, without having to create a variable for the codeunit. If it is related to multiple tables, or something that applies generally to a functional area, or that you could apply to multiple functional areas it could be a candidate for a codeunit.
  • navuser1navuser1 Member Posts: 1,329
    Thanks Daniel =D>
    Now or Never
Sign In or Register to comment.