Shortcuts

After inserting a new row

I'm new to Dynamic data I was wondering if anyone could please tell me how to create a new folder within the site directory after inserting a new row? I know how to create the folder using 'System.IO.Directory.CreateDirectory(path);' my only problem is getting
that to hit only after an insert.

Is it possible to achieve this without coding anything into the field templates or any other template?

I thought I had it working by using some of the partial methods such as onNameChanged() within my partial class, but that gets called regardless of whether your inserting, editing or deleting.

Re: After inserting a new row

Hi mmokri, you can just handle the FormViews OnInserted even in the Insert page, if this is just for one table you could check the table name there. if this is because you are uploading files the I usually create a fiel upload field template see mine here
Dynamic Data Custom Field Templates

Re: After inserting a new row

Re: After inserting a new row

mmokri

Could you please tell me how I would 'check the table name there'?

Hello：）

I don't think you can fetch the table name through the event here……And if you are using DD's Template，I think the current table name will be outputted automatically at the top of your page……Maybe you can right click your mouse to see the source of HTML codes，and
then use js or jQuery to save the table name in the HiddenField and take it out through the HiddenField。