Tuesday, 6 January 2015

Get automatic number sequence for a field in table and then insert record through code

HcmAbsenceID absenceid; // EDT of the field. ( create  object )
absenceid  = NumberSeq::newGetNum(HRMParameters::numRefabsenceentryID()).num();
HcmEmployee.AbsenceID = absenceid;
HcmEmployee.Name = "Sujana";
HcmEmployee.insert();
Insert  a new record in HcmEmployee with numbersequence.
===============================================================
[ In form  level  to get automatic number sequence.
if (!numberSeqFormHandler)
    {
        numberSeqFormHandler = NumberSeqFormHandler::newForm(HRMParameters::numRefabsenceentryID().NumberSequenceId,
                                                             element,
                                                             HcmEmploymentLeave_ds,
                                                             fieldNum(HcmEmploymentLeave,AbsenceID)
                                                            );
    }
    return numberSeqFormHandler;
]

No comments:

Post a Comment