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
Big EarsBig Ears 

Visualforce as an s-control replacement

One of the great things about s-controls was the ability to navigate to a new edit screen for a new record and fill in some of the fields automatically.

 

This could be acheived with a single line (or so) of code, but had drawbacks when any of the info had non-alphanumeric characters in it.

 

I was wondering if there was an easy way to do it in Visualforce. Currently, it seems that you have to produce mark-up for the record screen and produce apex code.

 

With thanks,

Andy

Best Answer chosen by Admin (Salesforce Developers) 
HarmpieHarmpie
You mean creating a custom link / custom button which passed all values as URL parameters? The approach here has not changed with APEX / Visualforce. Technically, a custom link like that is no s-control in the first place. (Ofcourse you could create something similar with Visual Force / APEX, but I don't think that's the most efficient way right now)
Message Edited by Harmpie on 10-07-2009 07:05 AM

All Answers

HarmpieHarmpie
You mean creating a custom link / custom button which passed all values as URL parameters? The approach here has not changed with APEX / Visualforce. Technically, a custom link like that is no s-control in the first place. (Ofcourse you could create something similar with Visual Force / APEX, but I don't think that's the most efficient way right now)
Message Edited by Harmpie on 10-07-2009 07:05 AM
This was selected as the best answer
slashrhslashrh
I have created a new object called Executive_Summary_Section_Comment__c 
 
Error: Method does not exist or incorrect signature: [SOBJECT:Executive_Summary_Section_Comment__c].setComment__c(String) 
 

 
public class PreviewTemplate 
{   

    Public void CreateRec()
    {
        String comment = 'new comment from class';

        Executive_Summary_Section_Comment__c ESSC = new Executive_Summary_Section_Comment__c();
        
        ESSC.setComment__c(comment);
        
        Executive_Summary_Section_Comment__c[] sObjects; 
        
        sObjects[0] = ESSC;
 
    }

}
slashrhslashrh
I had included the below statement right after the 'sObjects[0] = ESSC;' statement
 
SaveResult[] saveResults = binding.create(sObjects);

Big EarsBig Ears

Harmpie,

 

Thanks for this! I'd been using an overly complicated method to achieve what I needed, with s-controls and Javascript, when a simple custom button would have sufficed.

 

Thanks for pointing me in the right direction.

 

Andy