You need to sign in to do that
Don't have an account?
ethan hunt
Syntax Error in Javascript
Hi,
I am trying to assingn the below mentioned javascript to my custom button on VF page. But i am getting syntax error messsage. Kindly help to resolve.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
IF(ISBLANK({!Recruiter__c.CompanyName__c}))
{
alert ("Company Name cannot be blank");
}
else{
window.open('https://c.ap1.visual.force.com/apex/sid19');
}
I am not 100% clear about your requirements. Based on what I understand, you can display all Recruiters in apex:pageBlockTable and inside table create a link which will look like below
<a href="/apex/sid19?id={!Recruiter__c.Id}" target="_blank">{!Recruiter__c.Name}</a>
All Answers
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
if("{!Recruiter__c.CompanyName__c}"=="")
{
alert ("Company Name cannot be blank");
}
else{
window.open('https://c.ap1.visual.force.com/apex/sid19');
}
Seems like a misplaced bracket!
Hi Dev@Force,
Thankyou verymuch for your help.
Just one issue here.Sid19 is a VF page which is rendered as PDF.So now whenever i am calling a blank PDF is appearing.
Below is sid19 vf code - Could you please help how i can dynamically call the values from Recruiter ID's
If in the javascript i will put window.open('https://c.ap1.visual.force.com/apex/sid19')?Id = something. Then it will fetch me all the details. But i want to call dynamically .
--------------------------------------------------------------------------------------------------------------------------------
<apex:page standardcontroller="Recruiter__c" renderAs="pdf" >
<center>
<apex:form id="theForm">
<script type="text/javascript">
</script>
<apex:panelGrid columns="1" width="100%" >
<apex:outputText value="{!Recruiter__c.Name}" styleClass="companyName"/>
<apex:outputText value="{!Recruiter__c.CompanyName__c}" style="color:red;font-size:60px"/>
<apex:inputHidden value="{!Recruiter__c.Applied__c}" id="button" />
<apex:outputText value="{!NOW()}"></apex:outputText>
<apex:inputCheckbox value="{!Recruiter__c.Applied__c}" id="chek">
<apex:actionSupport event="onchange" reRender="ButtonId"/>
</apex:inputCheckbox>
<!-- <apex:commandButton value="Render PDF" disabled="{!Recruiter__c.Applied__c==false}" id="Button1"/> -->
</apex:panelGrid>
</apex:form>
</center>
</apex:page>
I am not 100% clear about your requirements. Based on what I understand, you can display all Recruiters in apex:pageBlockTable and inside table create a link which will look like below
<a href="/apex/sid19?id={!Recruiter__c.Id}" target="_blank">{!Recruiter__c.Name}</a>
Thank you...