Forum Discussion

didonato's avatar
didonato
Creator II
8 years ago

setProperty to NULL

topDeliveredComponent.setProperty("min_level","1"); My current code sets the property for "min_level" = 1, how do also include NULL values? I tried the following, but get an error: topDeliveredComponent.setProperty("min_level","1", null);

4 Replies

  • Hello, From the API Documentation found here, the third argument passed into the setProperty function represents the "Language for which the property needs to be set". However, you should be able to pass in 'null' to this argument without receiving an error. Could you please clarify what the error message you are receiving in? Chris _________________________________________ Christopher Gillis Aras Labs Software Engineer
  • Chris, topDeliveredComponent.setProperty("min_level","1",null); When I use this, it only retrieves min_level = 1, doesn't retrieve NULL values. topDeliveredComponent.setProperty("min_level",null); I also tried this to see if I could retrieve just null values, but I get the following error "Value for min_level is invalid (Input string was not in a correct format.)" Basically, I want to retrieve min_level that are = '1' and/or = NULL Thanks Chris  
  • Hello, I think I understand the problem now. In order to find all Parts that have a null property value, you can use the "condition='is null'" attribute. The example below shows how to get all Parts that have a null value for name.
    Item part = inn.newItem("Part", "get");
    part.setPropertyAttribute("name", "condition", "is null");
    part = part.apply();
    Please let me know if this returns the results you were expecting. Chris ___________________________________________ Christopher Gillis Aras Labs Software Engineer