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
How can you tell the version of Ubuntu on a system in a .sh (bash) script?
Is it unprofessional to mention your cover letter and resume are best viewed in Chrome?
Why are we moving in circles with a tandem kayak?
integration of absolute value
Create two random teams from a list of players
How can flights operated by the same company have such different prices when marketed by another?
Value of a limit.
Planting Trees in Outer Space
Gold Battle KoTH
Why are prop blades not shaped like household fan blades?
Were there any unmanned expeditions to the moon that returned to Earth prior to Apollo?
How to calculate points under the curve?
What do the novel titles of The Expanse series refer to?
Can living where Rare Earth magnetic ore is abundant provide any protection?
Balancing Humanoid fantasy races: Elves
Would people understand me speaking German all over Europe?
Word for soundtrack music which is part of the action of the movie
Why was the Lobbying Transparency and Accountability Act of 2006 deemed too weak?
Prepare a user to perform an action before proceeding to the next step
How to remove rebar passing through an inaccessible pipe
Coworker mumbles to herself when working, how to ask her to stop?
LWC: Removing a class name on scroll
Was Donald Trump at ground zero helping out on 9-11?
Patio gate not at right angle to the house
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;
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
New contributor
add a comment |
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
New contributor
add a comment |
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
New contributor
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
apex lightning
New contributor
New contributor
New contributor
asked 9 hours ago
Diego Edargo PessoaDiego Edargo Pessoa
182 bronze badges
182 bronze badges
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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]);
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
add a comment |
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[]" />
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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]);
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
add a comment |
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]);
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
add a comment |
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]);
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]);
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
8 hours ago
add a comment |
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
Thanks! @Dhanik Lal Sahni
– Diego Edargo Pessoa
8 hours ago
add a comment |
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[]" />
add a comment |
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[]" />
add a comment |
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[]" />
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[]" />
answered 8 hours ago
BlackCatBlackCat
3471 silver badge11 bronze badges
3471 silver badge11 bronze badges
add a comment |
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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