How to read Salesforce lightning components attributes from APEX

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite












This use case is tricky.
We need to have a way to read Salesforce lightning component attributes from the APEX code.
We don't want to pass the attributes from the Salesforce lightning javascript but wanna try to read the component attributes from the backend code.



Is it possible?










share|improve this question

















  • 1




    Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
    – user1974566
    2 hours ago







  • 1




    I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
    – sfdcfox
    1 hour ago










  • @sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
    – Caspar Harmer
    13 mins ago











  • Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
    – Caspar Harmer
    11 mins ago
















up vote
2
down vote

favorite












This use case is tricky.
We need to have a way to read Salesforce lightning component attributes from the APEX code.
We don't want to pass the attributes from the Salesforce lightning javascript but wanna try to read the component attributes from the backend code.



Is it possible?










share|improve this question

















  • 1




    Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
    – user1974566
    2 hours ago







  • 1




    I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
    – sfdcfox
    1 hour ago










  • @sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
    – Caspar Harmer
    13 mins ago











  • Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
    – Caspar Harmer
    11 mins ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











This use case is tricky.
We need to have a way to read Salesforce lightning component attributes from the APEX code.
We don't want to pass the attributes from the Salesforce lightning javascript but wanna try to read the component attributes from the backend code.



Is it possible?










share|improve this question













This use case is tricky.
We need to have a way to read Salesforce lightning component attributes from the APEX code.
We don't want to pass the attributes from the Salesforce lightning javascript but wanna try to read the component attributes from the backend code.



Is it possible?







lightning-components






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









newBike

1686




1686







  • 1




    Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
    – user1974566
    2 hours ago







  • 1




    I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
    – sfdcfox
    1 hour ago










  • @sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
    – Caspar Harmer
    13 mins ago











  • Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
    – Caspar Harmer
    11 mins ago












  • 1




    Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
    – user1974566
    2 hours ago







  • 1




    I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
    – sfdcfox
    1 hour ago










  • @sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
    – Caspar Harmer
    13 mins ago











  • Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
    – Caspar Harmer
    11 mins ago







1




1




Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
– user1974566
2 hours ago





Its actually very interesting question but my guess it is not possible to do something like that. LEX is like normal js framework and it is using standard client (web) server (backend apex) architecture. But maybe I am wrong and someone smarter would provide some more info about this topic
– user1974566
2 hours ago





1




1




I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
– sfdcfox
1 hour ago




I agree with Charles. This seems like an X-Y problem. You might want to take a step back and explain what you're trying to do.
– sfdcfox
1 hour ago












@sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
– Caspar Harmer
13 mins ago





@sfdcfox Lightning components are stored as a JSON object... perhaps it's possible to query for them. But of course, as Charles says, we are probably trying to solve the wrong problem.
– Caspar Harmer
13 mins ago













Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
– Caspar Harmer
11 mins ago




Of course, they would be in raw, unevaluated form... so many attributes would be invalid.
– Caspar Harmer
11 mins ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote













No. Those parameters are known only on the front end and never passed to the back at all. The whole idea of making calls to static functions in an Apex controller from Lightning is that behaviour should flow directly from the parameters passed in.



This seems like an X/Y problem. The question you are asking is confusing. What is the real problem you are trying to solve that makes you so reluctant to pass Lightning component parameters to Apex?






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "459"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f232681%2fhow-to-read-salesforce-lightning-components-attributes-from-apex%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    No. Those parameters are known only on the front end and never passed to the back at all. The whole idea of making calls to static functions in an Apex controller from Lightning is that behaviour should flow directly from the parameters passed in.



    This seems like an X/Y problem. The question you are asking is confusing. What is the real problem you are trying to solve that makes you so reluctant to pass Lightning component parameters to Apex?






    share|improve this answer
























      up vote
      3
      down vote













      No. Those parameters are known only on the front end and never passed to the back at all. The whole idea of making calls to static functions in an Apex controller from Lightning is that behaviour should flow directly from the parameters passed in.



      This seems like an X/Y problem. The question you are asking is confusing. What is the real problem you are trying to solve that makes you so reluctant to pass Lightning component parameters to Apex?






      share|improve this answer






















        up vote
        3
        down vote










        up vote
        3
        down vote









        No. Those parameters are known only on the front end and never passed to the back at all. The whole idea of making calls to static functions in an Apex controller from Lightning is that behaviour should flow directly from the parameters passed in.



        This seems like an X/Y problem. The question you are asking is confusing. What is the real problem you are trying to solve that makes you so reluctant to pass Lightning component parameters to Apex?






        share|improve this answer












        No. Those parameters are known only on the front end and never passed to the back at all. The whole idea of making calls to static functions in an Apex controller from Lightning is that behaviour should flow directly from the parameters passed in.



        This seems like an X/Y problem. The question you are asking is confusing. What is the real problem you are trying to solve that makes you so reluctant to pass Lightning component parameters to Apex?







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 hours ago









        Charles T

        5,1701518




        5,1701518



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f232681%2fhow-to-read-salesforce-lightning-components-attributes-from-apex%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery