This topic is locked
[SOLVED]

 Remove fields before add

7/18/2014 8:48:16 PM
ASPRunner.NET General questions
T
Tim author

Hello,
I have an add page that has 2 fields that aren't in the table I'm adding a record to, so the add fails, obviously. Is there a way I can remove these fields from the add statement? I see the "CustomAdd" under the "Add page" on the Events. Would that help? What is that used for? How is it used? (I didn't see this in the help file).
Thanks,

Tim

G
gonzalosb 7/21/2014

Hi timnorvel,

here is how to select what field to display and what not for each page from ASPR user guide:

choose fields
this works even with custom fields too.

admin 7/21/2014

You need to remove fields from joined tables in BeforeAdd/BeforeEdit events:

http://xlinesoft.com/asprunnernet/docs/update_multiple_tables.htm

T
Tim author 7/21/2014

Thank you. The link was exactly what I needed. This is really helpful.
note to self: The trick is value.Remove("FiledName"); in "Before record added" (this is for when I search on this again... my memory's not what it used to be... and it was never that good).
I'm still a bit curious about the "Custom add" on the Events page, but that's for another day, I suppose.
Thanks,

Tim

admin 7/22/2014

CustomAdd might work as well. This event is designed to completely replace the default Add function of ASPRunner.NET. In this specific case using CustomAdd would be an overkill.