Home Forums Development setProperty to NULL

This topic contains 4 replies, has 2 voices, and was last updated by  didonato 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10954

    didonato
    Participant

    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);

    #10957

    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

    #10958

    didonato
    Participant

    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

     

    #10959

    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

    #10984

    didonato
    Participant

    Thanks Chris!!!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.