Copy Document attached in HCMApplicant form to HCMWorker Form

Hi

I have a requirement which includes following things:

When I create Applicant and attach document in HR module , The attached document should get copied to Worker form whenever I create new worker.

Note:(Applicant and Employee are same one)

Can Somebody help me ?

You can use \Classes\Docu\copy

Hi Kranthi

where do i need to call this method?

How the worker is created? Can you tell the process?

Hi Kranthi

First I create applicant and attach document. So When I create a worker (for the same applicant) I need those document to be automatically get copied to worker.

I mean do you use any personnel action to hire worker or directly create it using HcmWorkerNewWorker form?

worker are created through HCMWorkerNewWorker form.

In closeOK method of the form write below line. In that method there is a if condition to check if the caller is HRMApplicatoin, you need to write in that if.
Docu::copy(hrmApplication, newHcmWorker);

HI kranthi… Do you mean too insert that above code here:

if (element.args().dataset() == tableNum(HRMApplication))
{
// We were called from the Application or Application List Page
// so set the status of the Application to Employed
ttsbegin;

hrmApplication.Status = HRMApplicationStatus::Employed;

//update employment start date in application form with worker’s employment start date
hrmApplication.StartDateTime = hcmEmployment.ValidFrom;

if (hrmApplication.validateWrite())
{
hrmApplication.update();

if (hrmApplication.dataSource())
{
// Tell the datasource to re-read its data so that
// the Applications form reflects the change
hrmApplication.dataSource().reread();
}
}
ttscommit;

Docu::copy(hrmApplication, newHcmWorker);

}