You need to sign in to do that
Don't have an account?
nagas
S-Control to VisualForce Page
hi ,
I have an S-Control in our Organization which needs to be replaced by VisualForce Page. Can anybody help me how to build a visualforce page for this S-Control logic. I am posting the S-Control logic below.
<script type="text/javascript"> if({!ISNULL( User.Partner_PIF__c )}) { alert("You do not have Access to PIF. Please Contact System Administrator for further assistance"); } else{ top.location.href ="/{!User.Partner_PIF__c}"; } </script>
While you can do this in VF, it would be simpler to create a custom button with execute javascript behaviour, then you just need a slightly tweaked version of you JS as the content:
Note that you don't need to wrap it in <script> tags either.
yes for button we can use this code. But my requirement is i need to create a visualforce tab and assigne that VF page to the tab. So when the user clicks on that Tab this functionality should be happened.
The way you'd do this is a VF page with a page-level action, declared like so:
Then your controller would have the checkuser method defined as:
Thus if the user doesn't have a Partner_PIF__c defined, they will stay on the page and get the error message.