Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 368 of 808  Not logged in ELOG logo
    icon2.gif   Re: Pre-populate filed based on selection, posted by Stefan Ritt on Tue Mar 15 03:48:58 2016 
Use "conditional attributes" as described in the documentation: https://midas.psi.ch/elog/config.html#conditional




Jimmy
Bria wrote:



Hi,
    icon2.gif   Re: Pre-populate Attachments in URL, posted by Stefan Ritt on Fri Aug 7 08:36:19 2009 
[quote="Erik Iverson"]Is there a way to pre-populate the new entry window with one or more attachments?  Per the documentation, this is easy to do with
attributes, i.e., http://localhost:8070/demo/?cmd=New&pauthor=joe&ptype=Info as a URL or bookmark will do it.  I'd like to do the same thing with attachments,
for example http://localhost:8070/demo/?cmd=New&pauthor=joe&ptype=Photograph&attfile1=picture1.jpg&attfile2=picture2.jpg might prepopulate two attachments,
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Stefan Ritt on Wed Mar 24 16:25:36 2021 
Nope, there is no way to acces the last value of an attribute. Sorry.

Stefan




Dominic
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Sebastian Schenk on Wed Mar 24 17:36:15 2021 
Sorry Stefan, but it is possible as you have the scripting ability.

The idea is to use "Preset Test_Attribute = $shell(script_to_get_the_last_entry)", where the script asks elog about the details and
parses them.
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Dominic Schneider on Wed Mar 24 19:30:50 2021 
Hi Stefan, hi Sebastian,

thank you for your help. Ok I see its not that simple.

Is there maybe a way of executing a Script on submitting, writing the values of the Attributes into an temporary file and loading the values
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Stefan Ritt on Wed Mar 24 19:45:41 2021 
That would actually be my recommendation. There is a "execute new" which you can call when submitting a new entry.

Stefan




Dominic
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Dominic Schneider on Thu Mar 25 07:48:24 2021 
Thank you very much.

So far I testet all functionalities and scripts to reach my goal. I will post a dummy of the solution later on for future purposes.

Best wishes 
    icon2.gif   Re: Pre-fill Attribute with last entry, posted by Sebastian Schenk on Thu Mar 25 12:50:08 2021 
I am glad, we could help.

I can see a caveat in the recommendation.
By having "Execute New = echo $attrib > /path/last_attrib" and "Preset attrib = $shell(cat /path/last_attrib)" as the most
ELOG V3.1.5-3fb85fa6