Tadeu Augusto Dutra Pinto,

You might also consider upgrading to use the 7.1 Java API. Where there
are a few other options....

   entry.put(Integer key, Value value)
    OR
   entry.putAll(Map<? extends Integer,? extends Value> map)

( So you can skip the EntryItem[] all together in the 7.1 API. )

But you still need to ( somehow ) have the client map the value to the
correct field(s). Sorry, but that does not magically happen. Some kind
of config file, or parsing schema, or way to loop over data can work
well for the task. But that part is up to your imagination as to how
it should be implemented for your business needs. And if you already
have the data in a Map then the 7.1 Java API might make it much easier
for you too.

Unfortunately, your code snip does not explain what "unidade" is or
how it is populated, etc... (but it looks like a custom object with
custom properties. So it is very hard to even try to suggest any
specific approaches for your more general needs

Hope that helps. (maybe some?)

-- 
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Love, then teach
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.


On Fri, May 30, 2008 at 3:06 PM, Tadeu Augusto Dutra Pinto
<[EMAIL PROTECTED]> wrote:
> **
> Hi everyone,
>
> I'm trying to use the Java API arapi70.jar...
>
> I'm implementing a code that read records of a file and enter this records
> in a form/table.
>
> I would like to know if there is a way to subtitute this code:
>
> EntryItem[] entryItems = new EntryItem[15];
>    entryItems[0] = new EntryItem(new FieldID((new
> Long("536870925")).longValue()), new Value(unidade.getData1()));
>    entryItems[1] = new EntryItem(new FieldID((new
> Long("536870918")).longValue()), new Value(unidade.getData2()));
>    entryItems[2] = new EntryItem(new FieldID((new
> Long("536870919")).longValue()), new Value(unidade.getData3()));
>    entryItems[3] = new EntryItem(new FieldID((new Long("4")).longValue()),
> new Value(unidade.getData4()));
>    entryItems[4] = new EntryItem(new FieldID((new
> Long("536870915")).longValue()), new Value(unidade.Data5()));
>    // set the entry items...
>    entry.setEntryItems(entryItems);
>    entry.create();
>
>
> In this case above, we have only 5 fields to be inserted in a form. But If
> there is more than one or two hundred of fields... Do I have to write 100 or
> 200 lines of code only insert it??? Considering that we have all values to
> all fields in destiny form.
>
>
> Thanks for any tips and/or suggestions...
>
>
>
> Tadeu Augusto Dutra Pinto
> -----------------------------------------------------------------
> IT Web Services ATM
> Cinq Technologies
> http://www.cinq.com.br
> [EMAIL PROTECTED]
> Fone: 41 3018-2833 - Cinq
> -----------------------------------------------------------------

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to