Reputation: 363
I am using apex 21.1. I am building a clinic management system.
scenario: A new patient goes to the secretary to tell him his name, age and other details. The secretary stores their data and record a visit. When the patient goes to the doctor, the doctor diagnosis the patient and write a prescription.
I have a report named VISITS and a form(Edit visit). The report displays patients' visits data and a link to edit the visit data in the form. The report has another column(link) that opens a dialog page(Examine Patient) which has a form for the doctor to store the complaint, diagnosis and other data of the patient and it has an interactive grid for the doctor to enter the prescription details i.e drug, dose, etc... . I've created another page( a report for the prescription that is printed using window.print() after the page is completely loaded and it closes too using window.close() after printing). The doctor should be able to call that prescription report and send it some data after submitting dialog page(Examine Patient) - after processing.
I tried to create a branch(after processing), and submitting the page through dynamic action with Action=submit and writing the code that calls the report page(prescription) in a subsequent action. All those tries did not solve the problem.
This is the code with which I call the new page
"apex.navigation.openInNewWindow('f?p=&APP_ID.:10:&APP_SESSION.:::10:P10_EXAMINATION_ID,P10_PRESCRIPTION_TYPE:&P2_ID.,E');"
Upvotes: 3
Views: 3513
Reputation: 18695
In the dialog page, create a dynamic action with "When" = Event: "Before Page Submit". Add a true action of type "Execute Javascript Code" with source
apex.navigation.openInNewWindow('f?p=&APP_ID.:10:&APP_SESSION.:::10:P10_EXAMINATION_ID,P10_PRESCRIPTION_TYPE:&P2_ID.,E');
This worked ok for me.
Upvotes: 1
Reputation: 1033
Perhaps generate and open a link, but just set the attribute:
target="_blank"
Setting this attribute in the link means it should open in a new tab.
Upvotes: 1