Solved

FSM: How to default a date field to now

  • 29 September 2021
  • 5 replies
  • 330 views

Userlevel 6
Badge +19
  • Superhero (Employee)
  • 181 replies

Hi,

 

Specifically for contract lines I want the COVERAGE_START_DT to default to today, not the contracts start date.

 

I’ve tried setting up the default in the custom metadata to ‘now()’ or ‘today()’, but this just errors on the UI…..probably the same on the UI designer itself?

I can’t find a relevant BR or App Param, so I guess the answer would be a client script, (it’s for the web client.)

Any better answer?

Thanks

 

icon

Best answer by GogBenbeH 23 October 2021, 14:40

View original

5 replies

Userlevel 7
Badge +18

Can you use the SQL expression SYSDATE?

 

Even better, in a global environment, you might want to use the site date for the user’s default site:

site_api.get_site_date(user_allowed_site_api.get_default_site)

Userlevel 6
Badge +19

Thanks for the reply ‘durette’, however I think you must be using IFS APPS rather than IFS FSM.

Userlevel 7
Badge +22

Hi @nickz ,

Not entirely sure whether you could set coverage_start_dt, end_dt  with expressions on UI designer as the values are being populated them selves based on the contract and contr_product parent-child relationship defined in the fsm metadata level.

As mentioned, it would be better to give it a try by updating the field with a client script.

A value BR (with now() expression on output column)  could also be an option, but you would not see the current date in real-time (will always pick what has been mentioned in the contract.start_dt) on the screen when adding the new line. Current date will be highlighted only after saving the record.

 

Userlevel 1
Badge

Hi 

 

Below are the steps I followed to get today’s date as default in any additional line included.

 

Step 1 : Go to UI Designer → Select “Coverage”

Step 2 : Select the coverage start date field from “Lines” tab

Set 3 : In the fields value → default Value → enter “Today” and save

 

Below is the test steps I did in the app.

 

After saving above changes, you can get the today’s date by default to ”Coverage start date” when adding new lines to contracts.

Thank you,

Rasangi

Userlevel 1
Badge +4

I generally use a default value ‘0’ similarly to how the stock screen sets dates when the stock record is created.

 

this works well on request at least so we have a date the request actually started being created vs saved.

Reply