Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

Question

I want to read the FiscalCalendar data source and get the FiscalData for today's date.

I tried using the api.find method but I get an error stating Could not find property 'attribute1' in the class net.pricefx.domain.DMDataSource"def fiscalDate = api.find("DMDS",Filter.equal("uniqueName","FiscalCalendar"),Filter.equal("attribute1","20170714")).

Answer

What you're looking for is api.getDatamartContext().

In the Analytics module, conversions of a certain Date into Fiscal Year, Quarter, Month and Week are done via a Data Source called "cal", found in Analytics. This is intended to be used only in Analytics, even though you can read it from within any logic in any module.

This Data Source is not populated by default, you must upload the conversion into it (using an XLS file).

Data Sources are queried using a Datamart query (you need to add due null checks and more):

ctx.executeQuery(ctx.newQuery(ctx.getDataSource(name)).select(...).where(...))
  • No labels