Skip to main content
Solved

Automate Purchase Order PDF Email


Did this topic help you find an answer to your question?
Show first post

30 replies

Forum|alt.badge.img+12
  • Hero (Customer)
  • 256 replies
  • August 12, 2024
Mounika wrote:
SimonTestard wrote:

Hey,

 

It would be done with this part of the cursor:

 

-- Doc Man
for doc_man_rec_ in (

select i.doc_class, i.doc_no, i.doc_sheet, i.doc_rev, e.file_no, e.user_file_name, e.doc_type, s.file_data
from ifsapp.doc_issue_tab i 
left join ifsapp.edm_file_tab e on e.doc_class = i.doc_class and e.doc_no = i.doc_no and e.doc_rev = i.doc_rev and e.doc_sheet = i.doc_sheet 
left join ifsapp.edm_file_storage_tab s on s.doc_class = i.doc_class and s.doc_no = i.doc_no and s.doc_rev = i.doc_rev and s.doc_sheet = i.doc_sheet and s.doc_type = e.doc_type
where i.rowstate = 'Released' and s.doc_type = 'ORIGINAL'
fetch first 1 rows only 

) loop

 

 

When you get the Purchase Order to Print, through the PDF_REPORT_CREATED event, you’ll get several parameters like result_key, print_job_id, etc.

 

From those parameters, you can retrieve the Purchase Order_No

 

Typically I do it like this:

 

From the Order No, you can then check documents attached to header/lines through the DOC_REFERENCE_OBJECT view/lu, based on the KeyRef:

Example here is for PurchaseRequisition but can be changed to PurchaseOrder or anything else to grab any attachment to any IFS Object.

 

This will give you the Document Keys to use to filter in the main cursor to grab documents attached to a given PO Line/Header

 

 

Hi @SimonTestard 

This code is to fetch the documents. But how can we send them to the printer?
For example, as soon as we send the PO report to physical printer, then we should also send these documents to print immediately along with the report. Is this possible?

 

I’m not exactly sure as this is to fetch and EMAIL Documents, if you want to send them to a printer, you’d need to add code to send them to a particular printer if what you’re after is a physical print :)

 

Are you actually after a PHYSICAL print of the attached documents ? This entire thread was about automatically emailing documents so I’m a bit confused.

 

You don’t need to PRINT attached documents if what you’re after is emailing them.


Forum|alt.badge.img+8
  • Sidekick (Partner)
  • 31 replies
  • August 12, 2024

Hi @SimonTestard ,

Yeah, you understood it right. I want them to be sent to physical print that too immediately after the order report print, so it is almost like attaching the documents to the report and printing them all at once as a single report.

This post is about emailing documents, but I hoped that since you worked on logic to fetch the documents, then may be you might also know about printing them.


Forum|alt.badge.img+12
  • Hero (Customer)
  • 256 replies
  • August 12, 2024

Sorry, can’t say I’m familiar with which API one would use to send a document management revision to a particular print agent, if it’s even possible.

The Print Job and Print Job Contents LUs are basically linked to result keys and therefore to Operational Reporting, so I don’t think you can use those to request a file print to a logical/physical printer through the print agents, but I could be wrong or not know how to do it

 

You could possibly do it through an Application Message using Routing Rules / App Message Queues and so on, but that’s not something I’ve done before


Forum|alt.badge.img+8
  • Sidekick (Partner)
  • 31 replies
  • August 13, 2024

Hi @SimonTestard ,

Understood. Thank you for all the info you shared so far!


hhy38
Superhero (Customer)
Forum|alt.badge.img+16
  • Superhero (Customer)
  • 318 replies
  • November 12, 2024

@SimonTestard Thank you for the script. It is beneficial


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings