Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Dynamic attribute values, posted by Steve Williamson on Wed Oct 7 16:17:34 2009 
    icon2.gif   Re: Dynamic attribute values, posted by Stefan Ritt on Tue Nov 10 15:00:15 2009 
       icon2.gif   Re: Dynamic attribute values, posted by Steve Williamson on Fri Nov 13 14:28:25 2009 
Message ID: 66594     Entry time: Tue Nov 10 15:00:15 2009     In reply to: 66557     Reply to this: 66600
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Question  OS: Linux  ELOG Version: 2.7.5 
Subject: Re: Dynamic attribute values 

Steve Williamson wrote:

Hi

I'm doing something wrong but can't work out what! 

I've created a new logbook with some date attributes that need to keep in step, e.g. one date ("receipt date") is set to the date the new record is created and another ("response required") to 7 days later.  The logbook doesn't use threaded messages, just a single page for each log entry with Submin/Preview/Back.  The dates are set with:

Preset Receipt Date = $date

Preset Response Required = $shell(gawk 'BEGIN{ print $Receipt Date + 86400 * 7}')

"receipt date" and "response required"  are set correctly when the log is written but if I change "receipt date" then "response required" is not altered - presumably because Preset only works on "New".  Tho I haven't found a way to make this dynamic with Subst.

When the log is updated later a third date may be entered ("proposal submitted") and this should calculate a fourth date ("proposal expires").  Again, I thought I could do this with some sort of "Subst" but can't work out how.  If I use Subst then the value of "proposal expires" isn't changed at all and if I use Subst On Edit then the value isn't changed until I go in to edit the log when the correct "proposal expires" date gets calculated and displayed, e.g.:

Subst On Edit Proposal Expires = $shell(gawk 'BEGIN{ if ($Proposal Sumbitted > 0) {print $Proposal Submitted + 86400 * 30}}')

Am I trying to do the impossible, and is there a document that will help me to understand when different updates (Preset, Subst, Subst On..., Change etc) happen and comparing their use?

Just try with the current version, where I reworked the "Subst" commands. See elog:66592. "Subst" work now only on "New", and "Subst on Edit" only works when editing an entry.

ELOG V3.1.5-fe60aaf