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
cptcpt 

How to create long[] array in apex ?

How to create array of long values in apex please solve me how to do .

GoldwinGoldwin

you can try this List<Long> obj = new List<Long>();

or

Long[] i = new List<Long>{1,6};

or

Long[] i = new List<Long>{1L,6L};

Pradeep_NavatarPradeep_Navatar

In apex there is a collection type called List that is similar to array so you can use it.

 

find below a sample code :

 

              List<datatype> My_List = new List<datatype>();

 

              // Iteration of list

              For(datatype md: My_List)

              {

 

              }

 

Hope this helps.

cptcpt

 i am created long array like this

 

String itemId='10250152';
        Long itemIds=Long.valueOf(itemId); // from the AddItem Service
        Long[] itemdIds;
        itemdIds[0]=itemIds;

 

but i cant able to assign this value to the method which contain parameter itemid of datatype ArrayOfLong which is yodlee collections

 

the method is from java web service of  yodlee  wsdl s

 

Object.displayAccountSummary(response, conversationSession, itemdIds);

 

Here the ItemIds is ArrayOfLong datatype

 

i cant assign my value itemdIds to this method showing error "Incorrect signature taking as a LIst<Long>

 

Save error: Method does not exist or incorrect signature: displayAccountSummary
 (transYintegDomyexpensesComXsd.CobrandLoginResponse, String, LIST<Long>)

 

 

please help me how to assignt the value ..