This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SUPPORT Q&A - Editing records with NASH

circuitweaver - Thursday, May 22, 2014 8:17 PM:

Hello Gurus and Gur-ettes,

    I am trying to get my feet wet with version 10, I have had some success with using the NASH interface to import around 2500 Mfg Parts, and around the same number of related Parts. Unfortunately, I missed the 'name' field on the majority of the Part records. Now I am trying to find some variation of using the <Item type="Part" action="get" xml syntax to add missing information to previously imported records:

<AML>

<Item type="Part" action="edit" where="Part.item_number='existing_record'"/><name>missing_name</name>

</AML>

results in malformed XML errors.

<AML>

<Item type="Part.name" action="add" where="Part.item_number='existing_record'"/><name>missing_name</name>

</AML>

results in "Failed to get the Part.name ItemType" errors

but:

<AML>

<Item type="Part" action="get" where="Part.name='part_name'"/>

</AML>

returns a valid record.

So, I tried:

<AML>

<Field type="Part.name" action="get" where="Part.item_number='existing_record'"/>

</AML>

Which leaves me back at malformed XML (<Relationship and <Related don't work either)

Does anyone know the correct callouts/syntax for this type of operation? I would imagine someone has had to resolve a similar situation in the past, any help is appreciated!



Brian - Monday, May 26, 2014 7:23 AM:

Hi Circuitweaver,

If that is the exact AML you used in NASH you are going to kick yourself.

You left the </Item> tag off the end of the statement.

The first statement is correct once you add the </Item> tag.

I suggest you go and have a look for "AML Studio" on codeplex (?) and use it rather than NASH. It's a free tool contributed by one of the community and does a great job of helping you build AML statements and not miss things like this.

Hope this helps,

Brian.



cool8808 - Thursday, June 26, 2014 11:05 AM:

I have same error for this code:

 

<AML>

<Item type="Part: action="add"> 

      <item_number>

      05090200121

      </item_number> 

      <name>

      Assieme RDCAM 

      </name>

     

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

                        <quanity>

                        1

                        </quantity> 

                        <related_id> 

                            <Item type="Part" action="add">                                 

                                  <item_number>

                                  05090200146

                                  </item_number> 

      <name>

      Assieme SEMILAVORATO RDCAM

      </name>

                          </Item> 

                        </related_id> 

                    </Item> 

            </Relationships> 

</Item>

</AML>



Brian - Monday, May 26, 2014 7:36 AM:

Hi Circuitweaver,

Just after I pressed send I realized that my statement was not correct. 

You are closing out the <Item> tag too soon.

A typical query should look like:

<AML>
  <Item type="Part" action="edit" where="part.item_number ='existing_number'" >
      <name>new name</name>
  </Item>
</AML> 

The properties of the Item type must be nested in the <Item>......</Item> tags

Hope this helps,

Brian.



circuitweaver - Thursday, June 26, 2014 1:02 PM:

Hello cool8808,

The first thing I noticed is that your initial statement is <Item type="Part: action="add">

it should be <Item type="Part" action="add">

I also noticed your final <name> statement is at a different indent than the rest of the object parameters for that entry, but I'm not sure that would cause an issue in Nash.

 



DavidSpackman - Thursday, June 26, 2014 11:14 PM:

cool8808, 

 

As circuitweaver mentioned you have an error in on the line below because the type attribute is not closed correctly 

  • <Item type="Part: action="add">  

Also,

  • The quantity tag is not spelt correct (therefore doesn't match the closing tag.)
  • Be aware of whitespace in your values

 

I would suggest using tools like AML Studio (http://amlstudio.codeplex.com/) to load your AML.

Apart from being more user friendly than the NASH tool, it will also allow you to Beautify and validate the syntax of your input before you apply to the server. (version 1.2 does the error checking, but latest version doesn't seem to)

I also use notepad++ and the XPatherizerNPP plug in, it has a Beautify feature that also validates syntax.

 

Dave



circuitweaver - Tuesday, May 27, 2014 1:22 PM:

Thanks Brian, I thought I had tried that variation previously, but if I did I must have had a syntax error! This worked perfectly! Thanks again!



pankaj - Friday, June 27, 2014 1:12 AM:

Cool DavidSpackman. You are doing brilliant job. Keep posting like this in Aras Forums.



cool8808 - Friday, June 27, 2014 5:36 AM:

ok I changed the code in this way:

<AML>

<Item type="Part" action="add"> 

      <item_number>05090200121</item_number> 

      <name>Assieme RDCAM - F149M - FERR 303209</name>

      <state>Preliminary</state>

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

<quantity> 

</quantity> 

<related_id> 

                           <Item type="Part" action="add">                                 

                                  <item_number>05090200146</item_number> 

      <name>Assieme SEMILAVORATO RDCAM - F149M</name>

      <state>Preliminary</state>

</Item> 

                        </related_id> 

                   </Item> 

</Relationships> 

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

<quantity>

1

</quantity> 

<related_id> 

<Item type="Part" action="add">                                 

                                  <item_number>09008500245</item_number> 

      <name>Sigillo Garanzia Apertura ART-FPS TOP</name>

      <state>Preliminary</state>

</Item> 

                        </related_id> 

</Item> 

</Relationships> 

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

<quantity> 

</quantity> 

                       <related_id> 

<Item type="Part" action="add">                                 

                                  <item_number>09008500140</item_number> 

      <name>Etichetta 21X9 mm </name>

      <state>Preliminary</state>

</Item> 

                        </related_id> 

</Item> 

</Relationships> 

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

<quantity> 

</quantity> 

<related_id> 

<Item type="Part" action="add">                                 

                                  <item_number>09008500212</item_number> 

      <name>RIBBON resin 430</name>

      <state>Preliminary</state>

</Item> 

</related_id> 

</Item> 

</Relationships> 

      <Relationships> 

                  <Item type="Part BOM" action="add"> 

<quantity>

1

</quantity> 

<related_id> 

                           <Item type="Part" action="add">                                 

                                  <item_number>ART10000021</item_number> 

      <name>SW RDCAM F149M</name>

      <state>Preliminary</state>

                          </Item> 

                        </related_id> 

                   </Item> 

</Relationships> 

</Item>

</AML>

 

 

I would like to create a BOM with the product code 05090200121 which has as parts codes: 

05090200146 

09008500245 

09008500212 

ART10000021 

 

The AML code that I write is correct but does not do what I want. 

Create only two parts: 

05090200121 

and this 

 

05090200146 

 

Where am I wrong?



pankaj - Friday, June 27, 2014 8:45 AM:

HI cool,

Could you keep only one Relationship tag like this.

<AML>
<Item type="Part" action="add">
<item_number>05090200121</item_number>
<name>Assieme RDCAM - F149M - FERR 303209</name>
<state>Preliminary</state>
<Relationships>
<Item type="Part BOM" action="add">
<quantity>
1
</quantity>
<related_id>
<Item type="Part" action="add">                                
<item_number>05090200146</item_number>
<name>Assieme SEMILAVORATO RDCAM - F149M</name>
<state>Preliminary</state>
</Item>
</related_id>
</Item> 
<Item type="Part BOM" action="add">
<quantity>
1
</quantity>
<related_id>
<Item type="Part" action="add">                                
<item_number>09008500245</item_number>
<name>Sigillo Garanzia Apertura ART-FPS TOP</name>
<state>Preliminary</state>
</Item>
</related_id>
</Item> 
<Item type="Part BOM" action="add">
<quantity>
1
</quantity>
<related_id>
<Item type="Part" action="add">                                
<item_number>09008500140</item_number>
<name>Etichetta 21X9 mm </name>
<state>Preliminary</state>
</Item>
</related_id>
</Item>
<Item type="Part BOM" action="add">
<quantity>
1
</quantity>
<related_id>
<Item type="Part" action="add">                                
<item_number>09008500212</item_number>
<name>RIBBON resin 430</name>
<state>Preliminary</state>
</Item>
</related_id>
</Item>
<Item type="Part BOM" action="add">
<quantity>
1
</quantity>
<related_id>
<Item type="Part" action="add">                                
<item_number>ART10000021</item_number>
<name>SW RDCAM F149M</name>
<state>Preliminary</state>
</Item>
</related_id>
</Item>
</Relationships>
</Item>
</AML>

 

Hope this will help.

Pankaj B