I assume your workflow is like this:
Record 1 value is entered as well as the percent.
The calculation then happens
Record 2 is created by user
Record 2 initial value gets filled in automatically
Record 2 calculation happens
Record 3 gets created
Record 3 initial value gets filled in automatically
Is that correct?
You probably would need to work with script triggers to grab the calculated value of the portal row record you are in and throw it in a global variable or global field. Then, in the initial value field, set another script trigger to fill in that field with the value in the global field / variable. The global something would always have the calculated value of the LAST portal row you entered and calculated, except for the first, obviously.
Here's another option.
When you go to portal row 2 and create the record, you could use GetNthRecord function: GetNthRecord( CalculatedValue; Get ( ActivePortalRowNumber ) - 1). You'd still have to put a script trigger on the Initial value field to run this function most likely. You'd have to error trap to make sure you're not in the 1st row of the portal. The GetNthRecord function works on the related records that are found in the portal.
Hi Jeremy and thanks for your long reply.
So, the second and all following lines are created time to time. I want to be sure that the reported value is done automatically not to allow any error. I quite new on this and do not apprehend how to transfer by script from one row to another. I wwould assume that the easiest way was to get the value while the new row is created, but It dont succeed in doing it.
I've tried with a ExecuteSQL function. then with GetNthRecord() which seemed to be the good solution but still with no success...
Hi. I just edited my reply above with GetNthRecord.
If you're in portal row 2, you want the value of the calculatedfield in the previous row. So you get the number of row you're on and use the function to get thevalue of the previous record (this portal row - 1).
Note, that this function will not respect your sorts in the portal, but that should not be a problem in this case as you're entering one after another.
1 of 1 people found this helpful
I've just succeed by doing this :
GetNthRecord ( Calculated value ; Get(RecordNumber) -1 )
Many thanks to you