This topic is locked

Redirect based on field content

5/21/2008 7:45:59 AM
ASPRunnerPro General questions
B
Bryan author

Hi,
I have a table called Clients with the following fields:
Client code, client name
Eg:
12345, Client X

98765, Client Y

45845, Client Z
Each Client requires standard and unique information stored against them.
EG:
Client X

  • Invoice No
  • Paid?
  • Bills to date
  • Amount paid to date
    Client Y
  • Invoice No
  • Paid?
  • Office billed
  • Next Invoice date
    Client Z
  • Invoice No
  • Paid?
  • Authorising code
  • VAT number
    Client Y and Z should never see Bills to Date and Amount Paid to Date, Client X and Z should never see Office Billed and Next Invoice Date, Client X and Y should never see Authorising code and VAT Number.
    Is there anyway on the CLIENT LIST page to have a link (with ajax view if possible) that redirects to a specific query/table based on the client code (so 3 separate INFO tables would be required)?
    or
    If all the information were stored to be stored in one table, is is possible to limit the view/editing of certain fields based on the client code?
    Many thanks in advance,

    Bryan

J
Jane 5/21/2008

Bryan,
create three views on the Datasource tables tab and add link to these views on the Visual Editor tab.

Use Client code in the names of views:

12345details

98765details

45845details
Here is a sample link:

<a href="{$row.1ClientCode_value}details_list.asp">link</a>

B
Bryan author 5/22/2008

Jane,
Thanks for the reply.
When I use your code, in the Visual Editor page it looks fine (the word LINK is displayed), however when published the links looks like this:
45845details_list.asp">link

1234tdetails_list.asp">link

etc
Any idea why it would look different when publishing?
Many thanks,

Bryan

J
Jane 5/22/2008

Bryan,
I suppose you use Inline Edit on this page. In this case the above method won't work.

As workaround edit your SQL query on the Edit SQL query tab:

select ClientCode,

ClientCode as link,

...

from DetailTableName



Then check off link field on the list page only on the Choose fields tab and set up this field as custom on the "View as" settings dialog on the Visual Editor tab.

Here is a sample code:

strValue = "<a href=""" & strValue & "details_list.asp"">Link</a>"

B
Bryan author 5/22/2008

Jane,
Absolutely perfect!
Thanks very much for your help.
Bryan