How can I confirmt that a report has run before I run other code.

hi,

I have a Menu Item consisteing of Offer Letter (report) and convert to employee .

Only when the offer letter is issued for that candidate ,it can be converted to employee.

How to check the condition in convert to employee whether offer letter is issued or not.

Please suggest.

This is the code I have written for Convert to employee

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);
glbrecempqual.INIT;
glbrecappqual.SETRANGE(glbrecappqual.“Applicant ID”,glbrecemp.“applicant id”);
IF glbrecappqual.FINDSET(FALSE,FALSE) THEN
REPEAT
glbrecempqual.TRANSFERFIELDS(glbrecappqual,TRUE);
glbrecempqual.“Employee ID”:=’’;
glbrecempqual.“Employee ID”:=glbrecemp.“No.”;
glbrecempqual.INSERT(TRUE);
UNTIL glbrecappqual.NEXT=0;
END
ELSE
MESSAGE(‘ALREADY EXISTS’);
END
ELSE
ERROR(‘Only Selected Candidates can be converted into Employees’)

So only when the offer letter is issued this code should work ,else it shoud give an error.

Please suggest

Hi Bavani,

I’m confused where the letter of offer fits in. It is a report run before this code?

Why not let the letter of offer report update the “Candidate Status” which controles the conversion?

report and convert to employee are two submenus of the menuitem.once the report is clicked then only the code behind the convert to employee should work

we are not understandin how to know the report is runned or not…

i have used the condition but it is giving an error like type void is not possible…

i am pasting the code

glbrecapp.SETRANGE(glbrecapp.“Applicant Id”,“Applicant Id”);
if REPORT.RUNMODAL(50100,TRUE,FALSE,glbrecapp)=true then ;
“Candidate Status”:=“Candidate Status”::Shortlisted;

second line of the code giving me an error

please guide me…

Hi Bavani,

REPORT.RUNMODAL does not return a value so this is generating the error.

Put the “Candidate Status”:=“Candidate Status”::Shortlisted; code in the body of the report and don’t forget the MODIFY