How are you declaring the transformer in the dataconfig?

On Mon, Oct 18, 2010 at 6:31 PM, Renato Wesenauer <
renato.wesena...@gmail.com> wrote:

> Hello guys,
>
> I need to indexing the first character of the field "autor" in another
> field
> "inicialautor".
> Example:
>   autor = Mark Webber
>   inicialautor = M
>
> I did a javascript function in the dataimport, but the field  inicialautor
> indexing empty.
>
> The function:
>
>    function InicialAutor(linha) {
>        var aut = linha.get("autor");
>        if (aut != null) {
>          if (aut.length > 0) {
>              var ch = aut.charAt(0);
>              linha.put("inicialautor", ch);
>          }
>          else {
>              linha.put("inicialautor", '');
>          }
>        }
>        else {
>            linha.put("inicialautor", '');
>        }
>        return linha;
>    }
>
> What's wrong?
>
> Thank's,
>
> Renato Wesenauer
>



-- 
______
Ezequiel.

Http://www.ironicnet.com

Reply via email to