Create and use Object Variablepass actionFunction name of variable to set in controller?Record Create on the GoogleDoc object within Visual WorkflowDate arithmetic expressions must use Integer or Long argumentsFill the WhoId and WhatId fields when create an eventLightning, display object fields on a different tabWhat fields and syntax for constructor to create records to add to a list<object>Create related object of certain Record Type on ObjectUsing Flow Designer, I'm trying to iterate through a list of items and put the value of a field in a list separated by a semi-colonHow to use an apex class variable in LWC javascript?Clarification on variable scope rules in Apex

Just how much information should you share with a former client?

Would people understand me speaking German all over Europe?

Was Donald Trump at ground zero helping out on 9-11?

Planting Trees in Outer Space

If the Moon were impacted by a suitably sized meteor, how long would it take to impact the Earth?

How can you tell the version of Ubuntu on a system in a .sh (bash) script?

Best Ergonomic Design for a handheld ranged weapon

May a hotel provide accommodation for fewer people than booked?

Why are we moving in circles with a tandem kayak?

How does Asimov's second law deal with contradictory orders from different people?

Applying for mortgage when living together but only one will be on the mortgage

Word for giving preference to the oldest child

Why was the Lobbying Transparency and Accountability Act of 2006 deemed too weak?

Help me, I hate squares!

In the Schrödinger equation, can I have a Hamiltonian without a kinetic term?

How to get Planck length in meters to 6 decimal places

LWC: Removing a class name on scroll

Prepare a user to perform an action before proceeding to the next step

Can you remove a blindfold using the Telekinesis spell?

Can I shorten this filter, that finds disk sizes over 100G?

Word for soundtrack music which is part of the action of the movie

Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?

Should students have access to past exams or an exam bank?

PCB design using code instead of clicking a mouse?



Create and use Object Variable


pass actionFunction name of variable to set in controller?Record Create on the GoogleDoc object within Visual WorkflowDate arithmetic expressions must use Integer or Long argumentsFill the WhoId and WhatId fields when create an eventLightning, display object fields on a different tabWhat fields and syntax for constructor to create records to add to a list<object>Create related object of certain Record Type on ObjectUsing Flow Designer, I'm trying to iterate through a list of items and put the value of a field in a list separated by a semi-colonHow to use an apex class variable in LWC javascript?Clarification on variable scope rules in Apex






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








3















How do I create an "Object" variable with two fields inside and assign value to these fields through this "for":



 for(RecordTypeInfo info: Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos()) 
if(info.isAvailable())
//Here i would add the value of the variables "info.getRecordTypeId(), info.getName()"
//in Object Name and Id fields.

//myObject.Name = info.getName();
//myObject.Name = info.getRecordTypeId();




I imagined an object variable like:



Object myObject = Name, Id


But I don't think that's how you create it. And if it is not ideal to use variable "Object" what would it be?










share|improve this question







New contributor



Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    3















    How do I create an "Object" variable with two fields inside and assign value to these fields through this "for":



     for(RecordTypeInfo info: Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos()) 
    if(info.isAvailable())
    //Here i would add the value of the variables "info.getRecordTypeId(), info.getName()"
    //in Object Name and Id fields.

    //myObject.Name = info.getName();
    //myObject.Name = info.getRecordTypeId();




    I imagined an object variable like:



    Object myObject = Name, Id


    But I don't think that's how you create it. And if it is not ideal to use variable "Object" what would it be?










    share|improve this question







    New contributor



    Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      3












      3








      3








      How do I create an "Object" variable with two fields inside and assign value to these fields through this "for":



       for(RecordTypeInfo info: Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos()) 
      if(info.isAvailable())
      //Here i would add the value of the variables "info.getRecordTypeId(), info.getName()"
      //in Object Name and Id fields.

      //myObject.Name = info.getName();
      //myObject.Name = info.getRecordTypeId();




      I imagined an object variable like:



      Object myObject = Name, Id


      But I don't think that's how you create it. And if it is not ideal to use variable "Object" what would it be?










      share|improve this question







      New contributor



      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      How do I create an "Object" variable with two fields inside and assign value to these fields through this "for":



       for(RecordTypeInfo info: Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos()) 
      if(info.isAvailable())
      //Here i would add the value of the variables "info.getRecordTypeId(), info.getName()"
      //in Object Name and Id fields.

      //myObject.Name = info.getName();
      //myObject.Name = info.getRecordTypeId();




      I imagined an object variable like:



      Object myObject = Name, Id


      But I don't think that's how you create it. And if it is not ideal to use variable "Object" what would it be?







      apex lightning






      share|improve this question







      New contributor



      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 8 hours ago









      Diego Edargo PessoaDiego Edargo Pessoa

      182 bronze badges




      182 bronze badges




      New contributor



      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Diego Edargo Pessoa is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          2 Answers
          2






          active

          oldest

          votes


















          3














          You can use List<Object> and List<List<Object>> to store different object like an array. Here is example



          string name='Dhanik';
          string id='111';
          List<Object> myObject = new List<Object>name,id;
          List<List<Object>> objects=new List<List<Object>>();
          objects.add(myObject);
          integer num1=1;
          myObject = new List<Object>name,num1;
          objects.add(myObject);
          system.debug('myObject:' + objects);
          system.debug('myObject:' + objects[0]);





          share|improve this answer

























          • Thanks! @Dhanik Lal Sahni

            – Diego Edargo Pessoa
            7 hours ago


















          2














          It is better to create separate strongly typed Apex class, if you want to use this data in lightning component.



          public class RecordTypeInfoObj 
          @AuraEnabled
          public Id recordTypeId get;set;
          @AuraEnabled
          public String name get;set;

          public RecordTypeInfoObj(Id recordTypeId, String name)
          this.recordTypeId = recordTypeId;
          this.name = name;




          List<RecordTypeInfoObj> recTypeList = new List<RecordTypeInfoObj>();
          for(RecordTypeInfo info : Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos())
          if(info.isAvailable())
          recTypeList.add(new RecordTypeInfoObj(info.recordTypeId, info.name));




          In lightning component define the following attribute



          <aura:attribute name="listOfRecordTypoInfos" type="RecordTypeInfoObj[]" />





          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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            Diego Edargo Pessoa is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f272027%2fcreate-and-use-object-variable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            You can use List<Object> and List<List<Object>> to store different object like an array. Here is example



            string name='Dhanik';
            string id='111';
            List<Object> myObject = new List<Object>name,id;
            List<List<Object>> objects=new List<List<Object>>();
            objects.add(myObject);
            integer num1=1;
            myObject = new List<Object>name,num1;
            objects.add(myObject);
            system.debug('myObject:' + objects);
            system.debug('myObject:' + objects[0]);





            share|improve this answer

























            • Thanks! @Dhanik Lal Sahni

              – Diego Edargo Pessoa
              7 hours ago















            3














            You can use List<Object> and List<List<Object>> to store different object like an array. Here is example



            string name='Dhanik';
            string id='111';
            List<Object> myObject = new List<Object>name,id;
            List<List<Object>> objects=new List<List<Object>>();
            objects.add(myObject);
            integer num1=1;
            myObject = new List<Object>name,num1;
            objects.add(myObject);
            system.debug('myObject:' + objects);
            system.debug('myObject:' + objects[0]);





            share|improve this answer

























            • Thanks! @Dhanik Lal Sahni

              – Diego Edargo Pessoa
              7 hours ago













            3












            3








            3







            You can use List<Object> and List<List<Object>> to store different object like an array. Here is example



            string name='Dhanik';
            string id='111';
            List<Object> myObject = new List<Object>name,id;
            List<List<Object>> objects=new List<List<Object>>();
            objects.add(myObject);
            integer num1=1;
            myObject = new List<Object>name,num1;
            objects.add(myObject);
            system.debug('myObject:' + objects);
            system.debug('myObject:' + objects[0]);





            share|improve this answer













            You can use List<Object> and List<List<Object>> to store different object like an array. Here is example



            string name='Dhanik';
            string id='111';
            List<Object> myObject = new List<Object>name,id;
            List<List<Object>> objects=new List<List<Object>>();
            objects.add(myObject);
            integer num1=1;
            myObject = new List<Object>name,num1;
            objects.add(myObject);
            system.debug('myObject:' + objects);
            system.debug('myObject:' + objects[0]);






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 8 hours ago









            Dhanik Lal SahniDhanik Lal Sahni

            9573 silver badges11 bronze badges




            9573 silver badges11 bronze badges















            • Thanks! @Dhanik Lal Sahni

              – Diego Edargo Pessoa
              7 hours ago

















            • Thanks! @Dhanik Lal Sahni

              – Diego Edargo Pessoa
              7 hours ago
















            Thanks! @Dhanik Lal Sahni

            – Diego Edargo Pessoa
            7 hours ago





            Thanks! @Dhanik Lal Sahni

            – Diego Edargo Pessoa
            7 hours ago













            2














            It is better to create separate strongly typed Apex class, if you want to use this data in lightning component.



            public class RecordTypeInfoObj 
            @AuraEnabled
            public Id recordTypeId get;set;
            @AuraEnabled
            public String name get;set;

            public RecordTypeInfoObj(Id recordTypeId, String name)
            this.recordTypeId = recordTypeId;
            this.name = name;




            List<RecordTypeInfoObj> recTypeList = new List<RecordTypeInfoObj>();
            for(RecordTypeInfo info : Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos())
            if(info.isAvailable())
            recTypeList.add(new RecordTypeInfoObj(info.recordTypeId, info.name));




            In lightning component define the following attribute



            <aura:attribute name="listOfRecordTypoInfos" type="RecordTypeInfoObj[]" />





            share|improve this answer





























              2














              It is better to create separate strongly typed Apex class, if you want to use this data in lightning component.



              public class RecordTypeInfoObj 
              @AuraEnabled
              public Id recordTypeId get;set;
              @AuraEnabled
              public String name get;set;

              public RecordTypeInfoObj(Id recordTypeId, String name)
              this.recordTypeId = recordTypeId;
              this.name = name;




              List<RecordTypeInfoObj> recTypeList = new List<RecordTypeInfoObj>();
              for(RecordTypeInfo info : Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos())
              if(info.isAvailable())
              recTypeList.add(new RecordTypeInfoObj(info.recordTypeId, info.name));




              In lightning component define the following attribute



              <aura:attribute name="listOfRecordTypoInfos" type="RecordTypeInfoObj[]" />





              share|improve this answer



























                2












                2








                2







                It is better to create separate strongly typed Apex class, if you want to use this data in lightning component.



                public class RecordTypeInfoObj 
                @AuraEnabled
                public Id recordTypeId get;set;
                @AuraEnabled
                public String name get;set;

                public RecordTypeInfoObj(Id recordTypeId, String name)
                this.recordTypeId = recordTypeId;
                this.name = name;




                List<RecordTypeInfoObj> recTypeList = new List<RecordTypeInfoObj>();
                for(RecordTypeInfo info : Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos())
                if(info.isAvailable())
                recTypeList.add(new RecordTypeInfoObj(info.recordTypeId, info.name));




                In lightning component define the following attribute



                <aura:attribute name="listOfRecordTypoInfos" type="RecordTypeInfoObj[]" />





                share|improve this answer













                It is better to create separate strongly typed Apex class, if you want to use this data in lightning component.



                public class RecordTypeInfoObj 
                @AuraEnabled
                public Id recordTypeId get;set;
                @AuraEnabled
                public String name get;set;

                public RecordTypeInfoObj(Id recordTypeId, String name)
                this.recordTypeId = recordTypeId;
                this.name = name;




                List<RecordTypeInfoObj> recTypeList = new List<RecordTypeInfoObj>();
                for(RecordTypeInfo info : Indicador_Clinico__c.SObjectType.getDescribe().getRecordTypeInfos())
                if(info.isAvailable())
                recTypeList.add(new RecordTypeInfoObj(info.recordTypeId, info.name));




                In lightning component define the following attribute



                <aura:attribute name="listOfRecordTypoInfos" type="RecordTypeInfoObj[]" />






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 7 hours ago









                BlackCatBlackCat

                3471 silver badge11 bronze badges




                3471 silver badge11 bronze badges























                    Diego Edargo Pessoa is a new contributor. Be nice, and check out our Code of Conduct.









                    draft saved

                    draft discarded


















                    Diego Edargo Pessoa is a new contributor. Be nice, and check out our Code of Conduct.












                    Diego Edargo Pessoa is a new contributor. Be nice, and check out our Code of Conduct.











                    Diego Edargo Pessoa is a new contributor. Be nice, and check out our Code of Conduct.














                    Thanks for contributing an answer to Salesforce Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f272027%2fcreate-and-use-object-variable%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                    Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                    Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її