function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rajesh k 10rajesh k 10 

URGENT:After calling javascript fiunction how to call outputlink URL?

Hi,

My javascript functio like below:

function MyFunction(iserror){
     //alert(iserror);
     if(iserror == true)
     {
     alert('Hello');
   
    }
    return false;
}

<apex:outputLink value="/apex/MyPage?RecId={!UR.Id}&ConId={!cid}" onclick="MyFunction({!isError})" >{!UR.Number__c}</apex:outputLink>

please help me..
Prem_PalPrem_Pal
Invoke your URL from JS function itself:

Use following code:

<a onclick="MyFunction({!isError},{!UR.Id},{!cid})>{!UR.Number__c}</a>
function MyFunction(iserror,id,cid){
     //alert(iserror);
     if(iserror == true)
     {
     alert('Hello');
   
    }
    window.open('/apex/MyPage?RecId=' + id + '&ConId=' + cid);
}

This is just a quick solution.



Cloud_forceCloud_force
if you want to call an apex controller method from a java script, you would need to use Action function component in visualforce.

thanks,
http://www.forcexplore.com/2014/01/salesforce-interview-question-1.html