1 Reply Latest reply on Sep 7, 2017 12:56 PM by jdass RSS
    bmitioglov Explorer

    How to pass parameters to purgeSelectedPropertyHistory correctly?

    Hi,


    I am trying to purge value streams for two properties. But getting the Null pointer exception after executing the following code:


    var params = {

    propertyNames: { "items": ["propA", "propB"] }

    };

     

    // result: INFOTABLE dataShape: "undefined"

    var namedProperties = me.GetNamedProperties(params);

     

    var paramsForPurge = {

    propertiesToPurge: namedProperties /* INFOTABLE */,

    endDate: Date.now(),

    startDate: new Date(new Date().setFullYear(new Date().getFullYear() - 1))

    }

    me.PurgeSelectedPropertyHistory(paramsForPurge);

     

    What I am doing wrong?

      • Re: How to pass parameters to purgeSelectedPropertyHistory correctly?
        jdass Apprentice

        Hi Boris,

         

        Please check if the GetNamedProperties service returns the correct property names (without the values).

         

        Or try using the PurgePropertyHistory service to purge the properties one by one and let me know if you are still getting the Null Pointer .

         


        var params = {
        propertyName: "propA" /* STRING */,
        immediate: true /* BOOLEAN */,
            endDate: Date.now(),
            startDate: new Date(new Date().setFullYear(new Date().getFullYear() - 1))
        };

        me.PurgePropertyHistory(params);


        var params = {
        propertyName: "propB" /* STRING */,
        immediate: true /* BOOLEAN */,
            endDate: Date.now(),
            startDate: new Date(new Date().setFullYear(new Date().getFullYear() - 1))
        };

        me.PurgePropertyHistory(params);