Convertion

Hi,

I have four tables employee,applicant,employee qualifications,applicant qualifications.

once if we click the button all the information from applicant should be converted into employee.this is working fine.

see,employee qualification is a dependent of employee i.e foreignkey relation ship…similarly with applicant and applicant qualification…

now what we required is when we click on button not only the information in the applicant card is converted but also the applicant qualification should go into the employee qualification.

I am pasting the piece of code::

IF NOT CONFIRM (‘Do you want to convert into employee’) THEN
EXIT ;
IF “Candidate Status” = “Candidate Status”::Selected THEN
BEGIN
glbrecemp.SETRANGE(glbrecemp.“applicant id”,“Applicant Id”);
IF glbrecemp.ISEMPTY THEN
BEGIN
glbrecemp.TRANSFERFIELDS(Rec,TRUE);
glbrecemp.“No.”:=’’;
glbrecemp.“applicant id”:=“Applicant Id” ;
glbrecemp.INSERT(TRUE);
REPEAT
glbrecemp.SETRANGE(glbrecemp.“applicant id”,glbrecappqual.“Applicant ID”);
glbrecemp.SETRANGE(glbrecemp.“No.”,glbrecempqual.“Employee No.”);
glbrecempqual.INIT;
glbrecempqual.“Institution/Company”:=glbrecappqual.“Institute/University”;
glbrecempqual.INSERT(TRUE);
UNTIL NEXT =0;
END
ELSE
MESSAGE(‘ALREADY EXISTS’);
END
ELSE
ERROR(‘Only Selected Candidates can be converted into Employees’) ;

please help it out …

Hi Bavani,

I think the problem is how you created the REPEAT - UNTIL statement.

This statement should be related to some FINDSET on the Applicant Qualification table.

I would suggest to you to add some filtering, and then a FINDSET before the REPEAT
e.g.
glbrecappqual.SETRANGE(“Applicant ID”,“Applicant ID”);
IF glbrecappqual.FINDSET(FALSE;FALSE) THEN
REPEAT

  • Code to create the glbrecempqual-record(s)
    UNTIL glbrecappqual.NEXT = 0;