Problems with XMLPort (nodename property)

RuubenRuuben Member Posts: 41
Hi, in a xmlport i've 2 elements whose names are:

- "PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_TRADICIONAL"
- "PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_ONLINE"


When i compile with F11 it works, but when i save it, next message is shown:

---
The C/AL object was not saved in compiled form. Compile it from the Object Designer and run it again.

Duplicate Identifier.Name=pCTN_HABITACIONES_OCUPADAS_TOU_Node.
---


If i try to compile it from object designer the same message is shown.

I've created this xmlport in version 5.0 and it works.

I think the problem is in long of the elements. This two elements are equals from character 1 until 30.

Is there any solution, or i must wait until a service pack?

Comments

  • kinekine Member Posts: 12,562
    Try to use shorter VariableName for both tags.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RuubenRuuben Member Posts: 41
    I can't use antoher variable name, it's obligatory than name
  • kinekine Member Posts: 12,562
    I am not talking about tag name, but about variable name... there are two properties, one for Tag name (you need to use what is defined) and Variable Name, which is used to give a name to the variable connected to the tag value (and which is limted by max. length for identificators in NAV).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RuubenRuuben Member Posts: 41
    Sorry, i don't understand it well. I don't know how i can assign a variable to the tag.

    This is my definition for the tag:

    Node Name = PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_TRADICIONAL
    Node Type = Element
    Source Type = Field
    Data Source = <PRECIOS>::Decimal3


    And their properties are:

    Indentation = 2
    NodeName = PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_TRADICIONAL
    NodeType = element
    SourceType = Field
    SourceField = <PRECIOS>::Decimal3
    FieldValidate = <Undefined>
    AutoCalcField = <Yes>
    Width = <0>
    MinOccurs = <Once>
    MaxOccurs = <Once>
  • kinekine Member Posts: 12,562
    Ok, I found the problem: if you use the SourceType = Field, there is no VariableName property. But if you define it as "Text", you can assign some VariableName, and assign the value to the table field in code. This can be workaround for you...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RuubenRuuben Member Posts: 41
    I've tried that way. The problem now is the tag doesn't take the value of the variable. As a test, i assigned a text value to the variable in the OnPreXMLport trigger and even then the tag doesn't show anything. It appears this way:

    <PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_ONLINE />
  • kinekine Member Posts: 12,562
    You need to assign the value in OnBeforePassVariable trigger of the tag...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RuubenRuuben Member Posts: 41
    I've tried this way and neither works. Here is declaration:

    Node Name = PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_ONLINE
    Node Type = Element
    Source Type = Text
    Data Source = "Texto1" (i've declared as 'texto1' too)

    Texto1 text(50) declared as global variable

    OnBeforePassVariable trigger --> Texto1 := 'test';


    Result is always the same:

    <PCTN_HABITACIONES_OCUPADAS_TOUROPERADOR_ONLINE />
Sign In or Register to comment.