Hello,
I'm a little stuck and could use a push.
I would like the ability to delete a file that is stored in a folder and referenced from an Image File Reference Field in a grid called Images. I have Allow Delete enable in the Update Settings: Permissions portion of the Grid. This only allows deleting the reference in the grid. I�d like to get to the file. The client folder for uploading images is created when creating a new client account. I have a form event on the Images.a5w page to allow the uploading of the files. The filename is stored in the Name Field of the grid.
I assume I need a script in the Event: CanDeleteRecord before the end with. How can I get the filename from the field Name of the grid based on the user selecting the delete checkbox? I�ve looked at the Xbasic for the grid and don�t know how to tie the two together. Any help would be appreciated.
filename = ????
if (filename = "") then
end
end if
If file.exists("[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + filename)
a5_file_remove("[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + filename)
end if
From the grid
with tmpl.field_info[3]
.Fieldname = "Name"
.Scope = "Local"
.DisplayFormat = ""
.DisplayUnFormat = ""
.Type = "C"
.Updateable = .f.
.Varname = "NAME"
.Column.LabelPosition = "Left"
.Controltype = "Label"
.Label.InLineStyle = ""
.BreakType = "None"
.nCols = 1
.Column.Hide = .f.
.Column.Heading = "Name"
.Column.Sort = "Name"
.Column.Type = "Freeform"
Thanks for any help,
Bob
I'm a little stuck and could use a push.
I would like the ability to delete a file that is stored in a folder and referenced from an Image File Reference Field in a grid called Images. I have Allow Delete enable in the Update Settings: Permissions portion of the Grid. This only allows deleting the reference in the grid. I�d like to get to the file. The client folder for uploading images is created when creating a new client account. I have a form event on the Images.a5w page to allow the uploading of the files. The filename is stored in the Name Field of the grid.
I assume I need a script in the Event: CanDeleteRecord before the end with. How can I get the filename from the field Name of the grid based on the user selecting the delete checkbox? I�ve looked at the Xbasic for the grid and don�t know how to tie the two together. Any help would be appreciated.
filename = ????
if (filename = "") then
end
end if
If file.exists("[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + filename)
a5_file_remove("[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + filename)
end if
From the grid
with tmpl.field_info[3]
.Fieldname = "Name"
.Scope = "Local"
.DisplayFormat = ""
.DisplayUnFormat = ""
.Type = "C"
.Updateable = .f.
.Varname = "NAME"
.Column.LabelPosition = "Left"
.Controltype = "Label"
.Label.InLineStyle = ""
.BreakType = "None"
.nCols = 1
.Column.Hide = .f.
.Column.Heading = "Name"
.Column.Sort = "Name"
.Column.Type = "Freeform"
Thanks for any help,
Bob
Comment