Hello Saddaf Khan
Thank you so much for the reply.
My apology for the unclear explanation I did there.
I will try to explain it in a much clearer context.
In AX, enum and Int64 datatypes work differently. I read from several other threads and blogs which said that for enum, we could do something like...this: CaseCategoryType::Service, however, for an Int64 datatype, we just cannot. It will complain with an error.
What I am trying to achieve is, to create a record in CaseDetailBase table/ CaseDetail table (both of these are AX default tables which you could find them via AOT), with default field values initiated for the user, without needing them to go through the pain of creating one for themselves via dialog, etc. So, for example, In CaseDetailBase, I want a record inserted with CaseId field, CategoryRecId field, other mandatory fields filled via X++.
If CategoryRecId were to be just an enum field, I could just do this: CategoryRecId::Service. However, the problem is that I cannot, as it is an Int64 datatype.
Here's the breakdown steps:
1) Try to insert a record into CaseDetailBase/ CaseDetail
2) Checks to see if a "Service" CaseCategory exists (maybe this could happen in AX's default CaseCategoryHierachyDetail table. In any case, I used the code below here for checking. However, if there is a better way than that, such as using methods provided by AX specifically for checking that, please do enlighten me.
Edit: After checking through CaseCategoryType, I misunderstood it as Case category, where in fact, it is a Category type...so the if statement below is a complete wrong usage...don't use it for reference as it's wrong...)
if (new DictEnum(enumNum(CaseCategoryType)).symbol2Value("Services"))
3) If no such CaseCategory exists, the program will create one for the user, automatically, via X++
4) Once "Service" CaseCategory exists, AX will proceed to create a record for the user
Have a look at the screenshot below:

If the above is still unclear, please do let me know ..
Thanks in advance.