What is the best way to prepopulate a new form entry with info from other most recent entries?

bcronrath
Kilo Guru

I was looking to make it so for a new table I created, if when a user first goes to enter a new entry, it prepopulates field info with info from the most recently created entry in that table.   Is the proper way to do this through dynamic defaults at the dictionary level?   If so I'm having trouble figuring out how to do this as the docs seem sparse to this functionality and it seems to want a filter only.   The other thing I was thinking was perhaps have a client script that populates the info onLoad, however I'm not sure how in this case I can do a check to make sure it's a new entry and not viewing an existing entry?

Best regards,

Brian

1 ACCEPTED SOLUTION

Brian,




In your onLoad client script add this condition


if(g_form.isNewRecord()){


write your code here


}


View solution in original post

7 REPLIES 7

Brian,




In your onLoad client script add this condition


if(g_form.isNewRecord()){


write your code here


}


Awesome, thank you Abhinay!


Sorry about that. My mistake. It should NOT have been a before/query BR, it should have been a display BR. Too many scripts today. 🙂 Glad you got it taken care of!