• shra1_dev
  • NEWBIE
  • 380 Points
  • Member since 2010

  • Chatter
    Feed
  • 13
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 47
    Questions
  • 111
    Replies

An org already has profiles assigned to specific users. The org installs a new application. The new application has profiles defined for users to interact with the new application. The new application also has permission sets with access similar to the profiles.

 

I have a class like this:

How can i write test class for this.

Please hellp me.

 

public class aaPage78 {
 public List<selectList> lists {get; set;}
 public aaPage78() {
  lists = new List<selectList>();
  for (Integer i = 0; i < 5; i++) {
   lists.add(new selectList(i));
  }
 }
 public PageReference test() {
  return null;
 }
 public class selectList {
  Integer intValue;
  String[] countries = new String[]{};
  public selectList(Integer intValue) {
   this.intValue = intValue;
  }
  public List<SelectOption> getItems() {
   List<SelectOption> options = new List<SelectOption>();
   options.add(new SelectOption('Value:' + intValue + ' - US','Label:' + intValue + ' - US'));
   options.add(new SelectOption('Value:' + intValue + ' - CANADA','Label:' + intValue + ' - Canada'));
   options.add(new SelectOption('Value:' + intValue + ' - MEXICO','Label:' + intValue + ' - Mexico'));
   return options;
  }
  public String[] getCountries() {
   return countries;
  }
  public void setCountries(String[] countries) {
   this.countries = countries;
  }
 }
}

 

 

Test Class:

 

I wrote the following test class to cover the above class.

But it gives only 52% code coverage. The red marked code did not cover.

 

@istest
private class testaapage78
{
    public static testmethod void m1()
    {
        aaPage78 obj=new aaPage78();
        obj.test();
    }
}

 

 

Can any one help me to covert the red marked code.

 

  • July 19, 2011
  • Like
  • 0

I know this is a very simple question, but my search in the IDE help revealed nothing.  If I have a method in a controller, how do I execute it in the view?  For example:

 

// ----------------------

// In the controller

 

    public static String test(String arg)
    {
        return arg;
    }

 

// ----------------------

// In the view

 

<div>{!test('foo')}</div>

 

Thanks!

 

~ devin

How can I create a form in like this way. This is in a Contact standard page. In here Title and first name are two fields. But they are apear in single line. How can I create this in visualforce?

my debug log keeps reaching the max size, and i guess it hits that max before it gets to any of my system.debug() text.

 

this is making it really hard to debug. it looks like my debug log has nothing but validation rules. most likely because our org has a lot of validation rules.

 

any advice?

I have following code. I want to know that is there any other approach to rewrite the highlighted code segment? That highlighted code area is not obey for best practices because there is a query in a loop.

 

 

public class Hierarchy {

public Employee__c employee;
public List<Team__c> team;

public Hierarchy(ApexPages.StandardController stdController){
employee=(Employee__c)stdController.getRecord();
}

public String getEmmployees(){
team=[Select t.Name, t.Id, (Select Name, Employee_Name__c From Team__r) From Team__c t];

for(Team__c tm:team){

}
//System.Debug('TEAM :: '+team.Name);
//System.Debug('TEAM :: '+team.Team__r.size());


return null;
}

public List<TreeModel> nodeList {get;set;}
public Hierarchy(){
nodeList = new List<TreeModel>();

for(Division__c acc : [Select d.Name, d.Id, (Select Id, Name From Teams__r) From Division__c d LIMIT 1000]){



if(acc.Teams__r.size() > 0){
TreeModel tm = new TreeModel();
tm.id = acc.Id;
tm.name = acc.name;
for(Team__c cnt: acc.Teams__r){
TreeModel tmChild = new TreeModel();
tmChild.id = cnt.Id;
tmChild.Name = cnt.Name;
tm.children.add(tmChild);

for(Team__c acc1 : [SELECT id, Name, (Select Id, Name,Employee_Name__c from Team__r) from Team__c LIMIT 1000]){


TreeModel tm1 = new TreeModel();
tm1.id = acc1.Id;
tm1.name = acc1.name;
if(tm1.id.equals(tmChild.id)){

for(Employee__C cnt1: acc1.Team__r){
TreeModel tmChild1 = new TreeModel();
tmChild1.id = cnt1.Id;
tmChild1.Name = cnt1.Employee_Name__c;
tmChild.children.add(tmChild1);
}

}

}
}
nodeList.add(tm);
}
}

}

public class TreeModel{
public string id {get;set;}
public string name {get;set;}
public List<TreeModel> children {get;set;}

public TreeModel(){
children = new List<TreeModel>();
}

}



}

 Thanks & Regards

Chamil Madusanka

 

Hi,

 

    My batch apex class for deleting the account records is

 

 

global class deleteAccounts implements Database.Batchable<Sobject>  
{  
global final String Query;  
global deleteAccounts(String q)  
{  
Query=q;  
}  
  
global Database.QueryLocator start(Database.BatchableContext BC)  
{  
return Database.getQueryLocator(query);  
}  
  
global void execute(Database.BatchableContext BC, List<SObject> scope)
{  
List<Account> lstAccount = new list<Account>();  
for (SObject s : scope)  //for all objects from our query
      
      {  
       Account a = (Account)s;
lstAccount.add(a);  
}  
Delete lstAccount;  
}  
  
global void finish(Database.BatchableContext BC)  
{  
                //Send an email to the User after your batch completes  
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();  
String[] toAddresses = new String[] {'nagalakshmi_b@dskvap,com'};  
mail.setToAddresses(toAddresses);  
mail.setSubject('Apex Batch Job is done');  
mail.setPlainTextBody('The batch Apex job processed ');  
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });  
}  
}

 

 

Now i want to execute the this code for deleting the records. how to execute this? can any one help me.

 

Thanks,

lakshmi.

 

 

HI,

Is there a way i cna delete existing related records under opporttunity such as product, when some oportunity fied changes? how would  go about it? any sample code would be gretly apreciated

  • May 03, 2011
  • Like
  • 0

Hi all,

 

I want to ask is it possible to view, create, edit Account or Contact records in Customer Portal? I only can create, edit, view Cases in Customer portal user.. I want to have access to Account or COntact using customer portal user. Any suggestions would be great..

Thanks...

 

 

Regards

Thanks for all the previous help and here goes one that might be even simpler but I can't get it to validate.

 

ublic class testchangeTrigger {
  public static testMethod void test1() {
    List<Lead> leads = new List<Lead>{ new Lead(FirstName='Test 1',LastName='Test 1',Status='Open',Company='Test1',Sales_Cycle__c='Not yet contacted'),
                                       new Lead(FirstName='Test 2',LastName='Test 2',Status='Open',Company='Test2',Sales_Cycle__c='Open') };
    insert leads;
    List<task> tasks = new List<task>{ new task(WhoId=Leads[0].Id,Subject='Get Appointment',ActivityDate=System.today(), stages__c='in progress'),
                                          new task(WhoId=Leads[1].Id,Subject='Something Else',ActivityDate=System.today()) };
    insert tasks;
    Lead[] leadsgo = [select id,Sales_Cycle__c from lead where id in :leads];
    System.assertEquals('Open',Leadsgo[1].Sales_Cycle__c);
    System.assertEquals('Contacted',Leadsgo[0].Sales_cycle__c);
  }
}

 and the trigger

 

trigger contacted on Task (after update) {
  Set<Id> recordIds = new Set<Id>();
  List<Lead> leadsToUpdate = new List<Lead>();

  for(task t:Trigger.new)
    if(t.subject=='Get Appointment' && t.stages__C=='in progress')
      recordIds.add(t.whoid);

  leadsToUpdate = [select id from lead where sales_cycle__C = 'Not yet contacted' and id in :recordIds];

  for(Lead l:leadsToUpdate)
    L.sales_cycle__C = 'Contacted';

  update leadsToUpdate;
}

 

I'm not sure if this will relate,  but the trigger is (after update) and when I had pretty much the same structure to test another trigger but (before insert) it worked fine.

 

Thanks a lot!

B

How to send record link to mail through approval processes?

Hi Guys,

I'm trying to build a lightning component which will be used on Opportunity lightning UI. The component is placed in the right panel. The component loads pretty well on any Opportunity record view.

The problem here is when I try to update the opportunity record (which comes as popup block) the component in the right panel is not getting refreshed. By this the updated values are not showing up on the lightint component.

Need to find a way to refresh the lightning component on record save.

Any help would be appreciated!! 

Thanks
Shravan 

 

Hi All, 

 

    I have VF Page with scrolling. This scrolling is working as expected when I open the VF Page. Now I kept this VF Page as Homepage Component. When We scroll the home page from top to bottom, once Its reached to the VF Page, then all the data inside the VF Page was scrolling first then the Home Page is scrolling next.  

 

Please see the Jing video Url :  

http://screencast.com/t/QHSxd7yc   

 

Any help would be greatly appreciated. 

Hi Devs,

 

Recently I come across with a strange Issue....

Have you ever come across..

 

I'm just trying to return list of Accounts. It says like thisStrange Issue

http://screencast.com/t/vxgtNJUG3

 

What could be the reason?

 

Thanks & Regards,

Shravan

Hi,

 

Would like to know whether there are any helpful classes and methods to Parse a JSON file by using Apex.

 

In Java we can utilize JSONObject to parse the JSON files.(http://www.json.org/java/)

 

Any help will be appreciated.........

 

 

Regards,

Shravan

Hi,

 

I have created a Detail Page Button Child__c object. For that I was using an Onclick javascript.

 

In that javascript I have given:

 

var ParentId = "{!Child__c.Parent__c}"; //where Parent__c is the lookup to the Parent__c object

alert(ParentId);

 

Alert prints the Parent Record "Name" where I was expecting the "ID". Why it is taking the Name? How to retrieve the Id without querying the object?

 

Please help me...

 

Regards,

Shravan

Hi,

 

My Approval fields are not populating on the Email Template.

What could be the reason?

 

I have created an email aklert for record rejection. I want to display the comments entered by the Approver in Email template. I have used the Approval merge field {!ApprovalRequest.Comments}  to display the comments..

 

But the comments are blank.

 

Please help me.. to retrieve the approval fields in Email template.

 

 

Regards,

Shravan

Hi,

 

 

I have created an Approval Process on Opportunity. Now I have assigned the Approvers as some Users (Rejection behaviour is on First Response). Those approvers has the same role and even me has the same role.

 

I have created a record and submitted it for Approval Process. Now even I could also approve/reject the record but I am not the approver.

 

Why I am getting the Approve/Reject link when I am not the approver?

Does any permission on Profile would matter?

 

Regards,

Shravan

Hi,

 

 

Is it possible to get the Field Id like we get the Object KeyPrefix from SObjectDescribeResult?

 

 

Regards,

Shravan

Hi,

 

Please let me know how the testing is done for time triggers.

 

 

 

Regards,

Shravan

Hi,

 

From the document the governor limit of time triggers on each milestone is 10.

 

But i am able to create only five time triggers on a milestone. When creating the sixth milestone is throwing the Error -Exceeded maximum number of time triggers on a milestone.

 

What could be the reason? (I am doing this in a developer edition will the limit vary in the Unlimited edition)

 

Please help me....

 

Regards,

Shravan

Hi,

 

I just want to know whether it is possible to get the old values(of record) while writing a validation rule.

 

And also I want to know the use of PRIOR value in Validation rules.

 

Please reply..

 

Regards,

Shravan

Hi Dev,

 

I have running the code in Test Class using system.runAs(User). Actually runAs(User) won't consider the License limits. 

 

But when i run my test class i am getting the license limitation. What could be the reason for this?

 

 

Help me...  Mine is an Enterprise Edition..Does this make a diff?

 

 

Regards,

Shravan

Hi,

 

I want a field to be displayed while entering the data and after the record is saved then the field should not be displayed in the detail page.

 

How to do this? (Standard  page layout only)

 

 

Regards,

Shravan

Hi,

 

For creating Entitlements i am using Entitlement Templates and adding it to the product.

 

If that product is added to the Service Contract then an Entitlement is created which is associated to the Account in Service Contract.

 

From Service Contract, Entitlement is carrying Account, Start Date and End Date but not Service Contract.

 

So how to associate the Service Contract in the Entitlement which is created automatically?

 

I need to know why the Service Contract is not carried in the Entitlement when it is carrying Account, Start and End Dates from Service Contract.

 

Please help me...

 

Regards,

Shravan

Hi,

 

 

Whenever an Account record is created in source org it has to be shared to dest org. I am doing it through after insert trigger on Account.

 

In that i was sharing the related records as well, that is relatedrecords = 'contact';

 

When i create a contact in source org for the account which is shared to dest org.

 

the contact is not been shared in the destination organization. How to make it to be shared to the destination org?

 

Should i write trigger on contact as well? If this is the answer, for how many related objects of Account, I should write the triggers.

 

Please give the solution....

 

 

Thanks & Regards,

Shravan

Hi,

 

Does any one now how to activate @remoteAction annotaion?

 

 

 

Regards,

shravan

Hi,

 

I am including a VF page in dashboard which contains google bar chart image.

 

now i am displaying that dashboard in home page.

 

When i click on refresh the VF page is not displayed after the refresh.

 

But when refresh the entire page the dashboard is coming again.

 

 

Why the dashboard is not refreshed when i click the refresh button provided in the dashborad section?

 

please help me...  i want the vf page to be displayed after refreshing the dashboard.

 

 

regards,

shravan

Hi Devs,

 

 

Is there any inbuilt function in apex which converts the month format from MMM to MM (i.e, FEB to 02)

 

how to convert MMM to MM?

 

Please help me....

 

Regards,

Shravan

Hi Devs,

 

I have few questions regarding AssignedTo field.


AssignedTo field in Event or Task is a lookUp in User or Calendar.

 

Why it is a lookUp to the Calendar(Is it neccesary)?Can we give a calendarId to this field?

 

If yes, how to select a calendar to this AssignedTo field?To do this what are the changes to be done to the calendar?

 

can this AssignedTo field accepts any other value which is not a User?

 

Regards,

Shravan

Hi Dev,

 

I am creating a VFPage which creates a contact. I am using Standard controller and inputfield for that.

 

Now the Problem is I am not getting the salutation inside the FirstName. How to do it?

 

Example:    FirstName : [  [\/]] [                    ]

       |             |

                                   Salutation    FirstName

 

 

Regards,

shra1

Hi Guys,

I'm trying to build a lightning component which will be used on Opportunity lightning UI. The component is placed in the right panel. The component loads pretty well on any Opportunity record view.

The problem here is when I try to update the opportunity record (which comes as popup block) the component in the right panel is not getting refreshed. By this the updated values are not showing up on the lightint component.

Need to find a way to refresh the lightning component on record save.

Any help would be appreciated!! 

Thanks
Shravan 

Hi,

 

    Please Let me know how to redirect to a page from javascript. This javascript is being called if any event occurs.

 

I was trying with

 

window.location('/apex/Pagename');

 

But it is not working.

 

Please help me...........

 

Regards,

 

shra1

Hi Guys,

I'm trying to build a lightning component which will be used on Opportunity lightning UI. The component is placed in the right panel. The component loads pretty well on any Opportunity record view.

The problem here is when I try to update the opportunity record (which comes as popup block) the component in the right panel is not getting refreshed. By this the updated values are not showing up on the lightint component.

Need to find a way to refresh the lightning component on record save.

Any help would be appreciated!! 

Thanks
Shravan 

An org already has profiles assigned to specific users. The org installs a new application. The new application has profiles defined for users to interact with the new application. The new application also has permission sets with access similar to the profiles.

 

Hi, Here is my scenario

 

1. I have a CFO PROFILE which announces the budget to buy some media (Stored in 'Media Finance' object). The STATUS field in this object is updated to 'BUDGET ALLOCATED' immediately.

2. The BUYER PROFILE buys the media one by one to create the line items. 

3. After creating the media line items, the buyer indicates that his purchases are DONE by clicking a 'PURCHASE DONE' CUSTOM button in the screen. This calls JAVASCRIPT function asking 'Are you sure?'. Now, if he presses 'Yes', then STATUS field in the 'Media Finance' object should go to 'MEDIA PURCHASED'. 

3. The 'Media Finance' object is the master for 'Media line items' object.

 

Constraints:

----------------

1. ORG DEFAULT for Media Finance object - PUBLIC READ ONLY

2. Media finance object has  START DATE, END DATE, BUDGET fields which are REQUIRED in the DB. I cannot make it to be 'required' only in the UI. These are absolutely required for the records in the DB.

3. I don't want to change the 'public read only' because all the fields on 'Media Finance' object should be absolutely read only for the BUYER profile.

 

What I tried:

----------------

1. I gave a 'MODIFY ALL' for BUYER PROFILE on 'Media Finance' object. This makes START DATE, END DATE, BUDGET also editable in the UI which is a chaos for BUYER.

2. I wrote a validation rule to make sure buyer is not updating START DATE, END DATE, BUDGET fields, but it does not solve the purpose. It still confuses the BUYER to do something other than pressing 'PURCHASE DONE' button.

3. Tried to update the record through JAVASCRIPT using sforce.connection method and it fails 'coz there is no permission.

4. My understanding is that, there is no way to give permission to edit only one field (while some other fields are 'required' in DB) in salesforce.

 

Is there any other better way to handle this situation? Your help is much appreciated.

 

Let's say I have two objects, Parent and Child, where Child is a related list of Parent.  

I can write a query to get all children named 'One' from all parents.  And this works.

SELECT Name, (SELECT Name FROM Child__r WHERE Name = 'One') FROM Parent__c

But, what if I wanted to get all children with the same name as their parent?  

I think this would look something like:  

SELECT Name, (SELECT Name FROM Child__r WHERE Name = Parent__r.Name) FROM Parent__c

But this is always returning a malformed query exception where Parent__r is an unexpected token.  Is it possible to do what I'm trying to do?  Or do I have to get the parents, then make a separate query for each parent to get the children that match that parents' name?

 

Hi All, 

 

    I have VF Page with scrolling. This scrolling is working as expected when I open the VF Page. Now I kept this VF Page as Homepage Component. When We scroll the home page from top to bottom, once Its reached to the VF Page, then all the data inside the VF Page was scrolling first then the Home Page is scrolling next.  

 

Please see the Jing video Url :  

http://screencast.com/t/QHSxd7yc   

 

Any help would be greatly appreciated. 

Hi

  I have created a VF page and in the controller it contain a list of object fields records. I have wrote a condition in it, if the condition is true then an error message should dispaly else the record should be displayed. 

 

eg: - in a object A.  i have fields b c d.

 

in a list i have the records of  b, c  and d. 

list contain 10 records. The first 3 the condition is true then  a error messag is shown else the value is dispalyes. 

 

The issue is i am getting an error message but it is diplaying 3 times according to the example. That mean it is displayes according to the number of condition gets true.

I want it to be displayed only once. 

Please help me to solve this problem.

 

Thanks

Anu 

Hi developers,

 

I am new into Salesforce but already got something! I created a custom view lead page and custom edit lead page.

 

Now I want to connect this two pages.

 

1)I created a custom button, that when the user will click on it, will redirect him to the edit visualforce page. The name of the button is "Edit_Fiscal_Info".

 

2) And here is my question: I want to add this button to the custom visualforce page of the lead, but I get lost in here.

 

Could someone please provide me with the necessary steps? I think i need to create a standard controller to add this button, but I dont know how to do it....

 

Thanks a lot.

 

Antonio

Is there any way in which I can fetch a single record by specifying the primary key?

Thank you.

 

~VK

I have developed a page where all users are shown,field i have made is Selected user

Selected user is not working with custom fields but is working with standard fields

 

eg

I wrote Account_Owner__c=:selecteduser;

then its not showing the desired result

 

but when i use createdbyid=:selecteduser;

it shows the record

 

Hi Devs,

 

Recently I come across with a strange Issue....

Have you ever come across..

 

I'm just trying to return list of Accounts. It says like thisStrange Issue

http://screencast.com/t/vxgtNJUG3

 

What could be the reason?

 

Thanks & Regards,

Shravan

Hi all,

 

Hopefully this is a simple one but I have a visualforce form which users use to load a lead, however, I want to populate a lookup field with the userid only when the user comes under a certain role.

 

I have tried this query to create the string

 

String userbasedid = [select ID from user where (userRoleid = '00EE0000000gXTj' AND id = :UserInfo.getUserId()].id;   

 

Piece of Form Code:

IdentifyUser = userbasedid

      

So the form works fine when the users role equals the above userroleid, however, as soon as a different user with a different user role uses it I get the error:

 

List has no rows for assignment to SObject.

 

So I need to figure a way that when the query result is null it doesn't try to populate the identifyuser field.

 

Thanks

Kev 

 

Hi All,

     I have to covered my apex class but there is issue due to param value setting

                         <apex:commandLink style="color:blue" action="{!ResubmitRequest}">Resubmit
<apex:param name="role" value="{!t1.Name}"/>
</apex:commandLink>

in apex code we getting the values as - 

public string change = ApexPages.currentPage().getParameters().get('role');

and now query on a object based on change condition.

 

i have my test method-

           PageReference pageRef = Page.myVFPage;
           ApexPages.currentPage().getParameters().put('role', testObj.Name);
           Test.setCurrentPage(pageRef);
           ApexPages.StandardController thecontroller = new ApexPages.StandardController(testFO);          
           CoverageHistory controller = new CoverageHistory(thecontroller);
controller.ResubmitRequest();


Issue is change values always getting null value.

Hi.

 

I want to ask how to create a test method for apex batch where there is method calling external web service? the external web service is created from generate apex from wsdl.. Any suggestions would be great..

Thanks..

Hi

 

<apex:page controller="Customer">
<script>
     function validate(){
     if (frm.pg.fname = ""
        alert("Name Cannot Be blank");
        return false;
        )
        else
        return true;
        }
</script>
    <apex:form id="frm" onsubmit="return validate()" >
        <apex:pageBlock id="pg" title="New Customer Entry">
            <p>First Name:
               <apex:inputText id="fname" value="{!firstName}"/></p>
            <p>Last Name:
               <apex:inputText value="{!lastName}"/></p>
            <p>Company Name:
               <apex:inputText value="{!companyName}"/></p>
            <p># Employees:
               <apex:inputText value="{!numEmployees}"/></p>
            <p>Department:
               <apex:inputText value="{!department}"/></p>
            <p>Email:
               <apex:inputText value="{!email}"/></p>
            <p>Phone:
               <apex:inputText value="{!phone}"/></p>
            <p>Title:
               <apex:inputText value="{!title}"/></p>
            <p>Address</p>
            <p>Street:
               <apex:inputText value="{!streetAddress}"/></p>
            <p>City:
               <apex:inputText value="{!cityAddress}"/></p>
            <p>State:
               <apex:inputText value="{!stateAddress}"/></p>
            <p>Zip:
               <apex:inputText value="{!postalCodeAddress}"/></p>
            <p>Country:
               <apex:inputText value="{!countryAddress}"/></p>

            <p><apex:commandButton action="{!save}"
               value="Save New Customer"/></p>
        </apex:pageBlock>
    </apex:form>
      <!-- Add related lists here -->
</apex:page

 

What is wrong in this form tag  "onsubmit="return validate()" "

When i don't write it is working fine , it adds record . I have put this condition to chech through Script that user should not enter blank First Name

 

Thanks

Hi Folks, I have a question regarding an example from the CookBook: "Retrieving a User's Location from a GPS-enabled Phone"

The issue is that I cannot get the latitude/longitude values to display on the form using an iPhone.

I'll use "longitude" as the example.  The functions look like this:

            function updateLocation(lat,lon) {
                document.getElementById('{!$Component.for.block1.longitude}').value="1.01"; /* lon; */
                document.getElementById('{!$Component.for.block1.latitude}').value="2.02";  /* lat; */
            }
            function getLocation() {
                mobileforce.device.getLocation(updateLocation);
                //work around required for Blackberry
                if (window.blackberry)
                    setInterval("getLocation()", 10000);
                    return false;
            }

 

And the apex:form like this:

    <apex:pageblock id="block1">
    Sales Visit Name: <br />
    <apex:inputField value="{!visit.name}" /><br />
    Sales Visit Description: <br />
    <apex:inputField value="{!visit.Description__c}" /><br />
    Longitude: <br />
    <apex:inputField  id="longitude" value="{!visit.Longitude__c}" /><br />
    Latitude: <br />
    <apex:inputField value="{!visit.Latitude__c}" /><br />
    <button type="button" value="GPS" onclick="getLocation();"> Get location </button>

 

On the Apex:inputfield tag for "longitude", I tried adding an "id" value but that did not appear to make a difference.

The original tutorial does not incldue this param.

What am I missing here?   I searched the forums but did not find any reference. I am sure that it is my lack of understanding JS.   thanks for any help.  -doug



 

Hi,

 

How to redirect to the previous page from current page(the page which has got by clicking a button/link in the previous page) through javascript.

 

I tried by using window.location(-1) and history.goback(-1). These are not working..

 

I don't want to specify the path of previous page in the action back button/link. Because the same page is used by two different roles and thier previous pages are different.

 

please help me.........