Forum Discussion

Former_Member's avatar
Former_Member
Accelerator III
8 years ago

Apply AML

hello I am trying to create method using apply AML here is my method but it shows some error Innovator inn = this.getInnovator(); string AML ="<AML><Item type='apn_assembly01'action='get'/></AML>"; Item result = inn.applyAML(AML); what I am missing here.  

7 Replies

  • What is the error? You can check your AML also under nash and have a better error description <SERVER>/Innovatorserver/Client/X-salt=std_11.0.0.6549-X/scripts/nash.aspx You have to change the bolded text with the server URL that you have
  • Apart from the missing space in your AML request your code seems to work : string AML =”<AML><Item type=’apn_assembly01’ action=’get’/></AML>”;   Léo
  • Maybe you forgot the close Item tag </Item>?
  • Hello, I believe Leo is correct. In your AML query, there should be a space between your type and action attributes as shown in his comment. Please note that the quotation marks used in these forums seem to be different than the ones expected in the method editor, so be careful about copying and pasting the code directly from his comment. Another potential issue is that all server methods expect a return value of an Item object. You can resolve this issue by returning the result of your AML query with return result;. Lastly, I want to mention that you can take advantage of the built-in API to avoid needing to use an AML inside of your server methods at all. You can see how you could perform the same query using the API below.
    Innovator inn = this.getInnovator();
    Item part = inn.newItem("Part", "get");
    part = part.apply();
    Chris ______________________________________________ Christopher Gillis Aras Labs Software Engineer
  • hello Mahmoud thanks for reply. i have check the space also not using bold font. error- method not fully specified.
  • hi Angela thanks fr rply. but If I had clesed query by </Item> it gives below error Details in 6 temporary files C:\Program Files (x86)\Aras11\Innovator\Innovator\Server\dll\jxw5nspk Line number -4, Error Number: CS0161, 'PKG_inf_applyAML_A1_9B4E9E7C26A53C9B.ItemMethod.methodCode()': not all code paths return a value.     if I wont add it shows - method not specified fully.
  • hi Christopher Gillis.thanks fr reply. yeah..we can use API. but requirement is through AML query. Yess. now its working fine