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
Øyvind Borgersen 10Øyvind Borgersen 10 

Convert VFP to LC


I have a VFP for uploading CSV files. This is working ok, but times out if the number of rows exceeds around 1000 lines. In order to prevent this I'm planning to convert the VFP to a LC. 

Can someone help me converting the following code? The function is to call the class and upload all data. Add error message if the file is not according to correct format and display the uploaded line count.

<apex:page controller="importDataFromCSVController">
    <apex:form >
        <apex:pagemessages />
        <apex:pageBlock >
            <apex:pageBlockSection columns="2">
                <apex:inputFile value="{!csvFileBody}" filename="{!csvAsString}" />
                <div align="center" draggable="false">
                    <apex:commandButton value="Import salesnumbers" action="{!importCSVFile}" />
                <!--<div align="center" draggable="false">
                    <apex:commandButton value="Upload sales numbers" action="{!uploadCSVFile}" />

        <apex:pageBlock >
            <p> Number of uploaded salesnumbers: </p>
            <apex:outputText value="{!vidlist.size}" />
Lottery Sambad 18Lottery Sambad 18
Thanks for this nice post Dear Lottery Sambad (
Lottery Sambad 18Lottery Sambad 18

[url=]Lottery Sambad[/url]
ANUTEJANUTEJ (Salesforce Developers) 
Hi Øyvind,

There is no direct way as such to convert vfpage to lc but you can implement a similar scenario in lc from scratch.

For reference link:

Apart from the above I also found the below way to put a vfpage in lc below is the link.


Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you