CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 Redirect from list based on if userid is salesperson or not

Print topic Send  topic

Author Message
robn

Posts: 70
Posted: 07/21/2006, 7:31 AM

Hi there

I've searched the site up and down (I'm sure I have missed the resolution somewhere) the site and found plenty of information of page redirection but can't find what I'm looking for.

What I need to be able to do is from a list screen when the user selects a record to view, onclick the system checks to see if the logged in user (userid) is that records Saleperson. If they are then they get an updatable view (HBFF2A.asp) if they are not then the only get a read only view (HBFF2B.asp) along with the records ID (OID). I've tried the following code to Href Source of the link but it doesn't seem to work.

Java =

function ViewOpportunityFromList()  
{  
If (document.0pportunity.Salesperson.value ==(session("userid")))   
		e.getPage().setRedirectString("HBFF2A.asp");  
Else   
		e.getPage().setRedirectString("HBFF2B.asp");  
}

and

function ViewOpportunityFromList()  
{  
If (document.Opportunity.Salesperson.value ==(session("userid")))   
	window.location = "HBFF2A.asp";  
Else   
	window.location = "HBFF2B.asp";  
}

These both return the error "document.Opportunity.Salesperson is null or not an object". I think this may be to do with it been a list screen not a record screen?

Also when I try the following VBScript code

function ViewOpportunityFromList()  
If Salesperson.value = (session("userid")) then  
	Redirect = "HBFF2A.asp"  
else  
	Redirect = "HBFF2B.asp"  
end if  
end function

with the on click code being

VBScript:ViewOpportunityFromList(this.form.Salesperson.value)

I receive the following error message

"object required 'this'".

i'm currently developing in ASP with SQL2000

Any help on how I may achieve my requirement to load either the update form or view form based on the userid from a list screen would be much appreciated.

Many thanks in advance

Rob
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.