You need to sign in to do that
Don't have an account?
anju
How to embed scontrol in visualforce?
Hi,
I have an scontrol page. I want to remove the scontrol and need to embed that scontrol in visualforce. Is it possible? If so then how?
I don't want to use -
<apex:page>
<apex:outputLink value="{!$SControl.HelloWorld}">Open theHelloWorld s-control</apex:outputLink>
</apex:page>
and
<apex:page>
<apex:scontrol controlName="HelloWorld" />
</apex:page>
Is it possible to copy and paste scontrol in visualforce? Please help me.
Outside of the above, you should be able to copy and paste it in. HOWEVER, you should think twice before doing this. For one, what is the benefit? simply a named container around your scontrol? For another, you are missing out on many of the benefits of visualforce vis-a-vis scontrols.
If you have some time you might want to watch this webinar recording
<html>
<head>
<script src="/soap/ajax/10.0/connection.js"></script>
<script language="Javascript" type="text/javascript">
function savevalues()
{
var strServiceRequestId="{!$CurrentPageReference.parameters.id};"
// var strServiceRequestId="{!Service_Request__c.Id}";
var obj=new sforce.SObject("Service_Request__c");
obj.Id=strServiceRequestId;
obj.Status__c="Closed";
alert("000");
try
{
var updateServiceRequestResult=sforce.connection.update([obj]);
}
catch(e)
{
alert("Error in updating : "+e);
}
}
</script>
</head>
<body>
<input type="button" onclick="savevalues();" value="Click" />
</body>
</html>
</apex:page>
Error in updating: {faultcode:sf:INVALID_SESSION_ID’,faultstring: INVALID_SESSION_ID’: invalid Session Id found in session Header: Illegal Session’, detail:{UnexpectedErrorFault:{exceptionCode: ‘INVALID_SESSION_ID’, exceptionMessage: ‘Invalid Sesssion ID found in sessionHeader: Illegal Session’,},},}
Please give me a solution for this.
Sorry, I see you said you don't want to use <apex:scontrol />. Why not?
Is it possible to copy and paste my existing scontrol code in visual force tag - <apex:scontrol/>?
If so then please tell me how can i do that. I tried but got some error.
We'd be happy to help you if you would take a moment to answer the questions we have raised. It's possible you are heading down a path that is going to cause you unnecessary pain which we are trying to help you avoid by qualifying a couple of things.
Can you please respond to aballard's question? I'd still like to know why you want to move this to a Visualforce page - what is the benefit you are looking for if you are just copying and pasting it?
Also, perhaps if you described the functionality of your scontrol you might get someone to respond with a basic Visualforce page that could get you started down the right path.
Actually we have an existing scontrol. It is a custom object new & edit page. Save button in the custom object we will update other 3 objects along with creation/updation of this record. It is a lengthy scontrol with so many validation rules. We have done this scontrol in Salesforce Standard CRM application.
Now we want to do this scontrol in Force.com(This app is a copy of the previous one). As per the requirement, we want to convert all scontrols to Visualforce (scontrols will be deleted once we convert it into VF).
I heard that we can copy and paste a scontrol inside Visualforce <apex:page/> tag(but I didn't find any doc for this).
If we are writing this from scratch in VF we need to do all validations again in <script/> tag in VF and we need to design the UI in VF. In scontrol we are using 2 Create and 3 Update SOQL statements. So for this we need to create custom Controller. I would like to avoid this double work.
That's why I am ask this question. Is there is any way to copy and paste scontrol in VF?