This topic is locked

Marked for Deletion/Detail Listed

1/6/2008 10:56:52 PM
ASPRunnerPro General questions
R
RICHARD96 author

I have a field in my MS-SQL database Table which allows a Authorised USER to specifiy a record 'Marked for Deletion' (1 = marked, 0 = unmarked) and another field in the same record which only ADMIN can change which is 'Detail Listed' (0 = No, 1 = Yes).
The problem I have is that if a record is 'Marked for Deletion' by a USER then I don't want the record to appear at all in the List and View Pages (although of course it will remain in the database) BUT still be listed in the Edit page (in case a USER changes their mind).
Similarly if a record is marked by ADMIN as Detail Listed = 0 I still want the Fields NAME and PHONE to appear as Read Only in the List and View Pages but nowhere else (as the most likely cause is they haven't paid their account).
Is there a way I can use an SQL view to achieve this? Is there another way to do this?

J
Jane 1/11/2008

Richard,
you can do it editing SQL query on the Edit SQL query.

Here is a sample SQL query:

select

field1,

field2,

...

from TableName

where

[Marked for Deletion]=0


Check Marked for Deletion field on the edit page only on the Choose fields tab.
Regarding the second question.

You'll need to edit your pages on the Visual Editor tab manually.

For example edit your edit page on the Visual Editor tab in the following way:

  • find this code:

    <TR>

    <TD width=150>NAME</TD>

    <TD width=250>{build_edit_control field="NAME" value=$value_NAME mode="edit"}</TD>

    </TR>


  • and replace it with this one:

    {if $value_Detail_Listed!=0}

    <TR>

    <TD width=150>NAME</TD>

    <TD width=250>{build_edit_control field="NAME" value=$value_NAME mode="edit"}</TD>

    </TR>

    {/if}