May 19, 201510 yr Newbies Hello, I am setting up a production/labor tracking database for our printing plant. The users in our various departments are to log in and record their labor time using the portal display. I have one layout for each department that has a start time and a stop time function. The prepress department portal needs to have a minimum time on the first in/out record if the actual labor is less than 25 minutes. I have attached a script that works correctly only if the user is under 25 minutes on the first record. I the user works over 25 minutes the record still shows 00:25:00. I have set the attached script to function "On Record Commit" in the prepress layout.
May 19, 201510 yr Note that if you're accessing the first related record, you don't need a portal. Also, you can simplify the script to one line: Set Field [Target field: AllData::prePressTotalSpecify result:Max ( AllData::prePressTotal ; Time ( 0 ; 25 ; 0 ) )] Edited May 19, 201510 yr by eos
May 19, 201510 yr Author Newbies Hello, I only need a minimum value for the first record. The additional records are correct as is. The suggested script is not showing the minimum "00:25:00" value. The "prepresslinetotal" field is showing just that actual time entered. I tried with and without the "Go To Portal" and "Go To Field" steps, no effect on the calculation. I tried to use "Min" function with the same results. Thank you for your help!
May 19, 201510 yr Is your total field a calculation field? You cannot set such a field field, neither manually nor via script. Instead, use a regular number field with an auto-enter calculation; if you know beforehand which record is the first one, you could continue to use a calculation, but one that returns the Max() of the duration (stop-start) or 25 Mins. See the attached sample file. Maximum_eos.fmp12.zip
May 27, 201510 yr The second Set Field step in your script (after the Else If) will not work as the field to be set is not specified, only the result to be posted. On the other hand, see comments above if the target field you intend to be set is in fact a calc field.
May 27, 201510 yr Without a specified target field, the target field is the currently active one (if any).
Create an account or sign in to comment