blog image

How to calculate dynamically date minus constant in siebel expressions

We have a requirement to change the calculated expression for the created filed in the siebel batch jobs based on the enviroment. For the production enviroment the batch job selects records which were created for example 7 days ago to generate invoices. For the development and testing enviroment there is a requirement, to short this period because of testautomation which cannot wait.

We decided to use system preference constant to use for the calculation of the selected records based on created field.

Before following expression was used : Today() – 7. For the production enviroment we need to keep 7, for the testing and development enviroment we need to have it equal to 1. We decided to use siebel System preference to keep the constant and the system preference will be deployed for each type of enviroment with needed value.

Starting with PoC we have tried several expressions but without success. We want to share with the world the working expression , which is probably not documented.

The expression can be used in Siebel for :

  • Batch Jobs
  • Calculated Fields
  • Search Expression for the BC, Applets, Data Maps
  • Workflows

This is the prooved working expression :

[Created]<=ToChar(Today()-(0+SystemPreference("MOBITimeTestD")),'MM/DD/YYYY')

where MOBITimeTestD is the System Preference which decides how many days back are used to fileter the data.

We hope this will be of a help for you.

Skôr ako začneme: nahliadnite do spracovania vašich osobných údajov

Ak navštívite stránku, ktorá zapisuje cookies, v počítači sa vám vytvorí malý textový súbor, ktorý sa uloží vo vašom prehliadači. Ak rovnakú stránku navštívite nabudúce, pripojíte sa vďaka nemu na web rýchlejšie. Náš web vám ponúkne relevantné informácie a bude sa vám pracovať jednoduchšie.

Súbory cookies používame najmä na anonymnú analýzu návštevnosti a vylepšovanie našich web stránok. Ak si nastavíte blokovanie zápisu cookies do vášho prehliadača, je možné, že web sa spomalí a niektoré jeho časti nemusia fungovať úplne korektne. Viac info k spracúvaniu cookies.