Skip to main content
Solved

Schedule Quick Report - Dynamic Period

  • December 11, 2025
  • 2 replies
  • 31 views

Forum|alt.badge.img+16

++Repost to the right queue

Community, 

We are scheduling a Inventory Period Statistic Report, it is scheduled on the 1st day of each month. Our inventory statistical period is created on each month basis.

 

We would like system to fetch dynamically on Parameter Period. If it is running on Dec.1, 2025, then 12 should be feched to paramter Period field. What function/SQL statement we should us in field Period? Thank you.

Best answer by Tracy Norwillo

@ronhu Can you change your SQL to pull the current year and current period instead of prompting for them?

I’ve added the api’s to the SQL so you can see how it would work.  Adjust as necessary to show your desired fields.

select h.*
,accounting_period_api.get_curr_acc_year(company_site_api.get_company(contract)) curr_year
,accounting_period_api.get_curr_acc_period(company_site_api.get_company(h.contract)) curr_period
from inventory_part_period_hist h
where stat_year_no = accounting_period_api.get_curr_acc_year(company_site_api.get_company(h.contract))
and stat_period_no = accounting_period_api.get_curr_acc_period(company_site_api.get_company(h.contract))
and h.contract = '&Site'

2 replies

Forum|alt.badge.img+14
  • Superhero (Partner)
  • Answer
  • December 23, 2025

@ronhu Can you change your SQL to pull the current year and current period instead of prompting for them?

I’ve added the api’s to the SQL so you can see how it would work.  Adjust as necessary to show your desired fields.

select h.*
,accounting_period_api.get_curr_acc_year(company_site_api.get_company(contract)) curr_year
,accounting_period_api.get_curr_acc_period(company_site_api.get_company(h.contract)) curr_period
from inventory_part_period_hist h
where stat_year_no = accounting_period_api.get_curr_acc_year(company_site_api.get_company(h.contract))
and stat_period_no = accounting_period_api.get_curr_acc_period(company_site_api.get_company(h.contract))
and h.contract = '&Site'


Forum|alt.badge.img+16
  • Author
  • Hero (Customer)
  • December 25, 2025

@Tracy Norwillo Thank you for your reply.

I have talked to IFS about this dynamic parameters, they suggest me to do the same.

Your input does help.