1 Reply Latest reply: Feb 22, 2018 3:16 PM by Erik Wetterberg RSS

    Update multiple master measures in go using Engine API

    Pradeep Das


      I have a mashup application wherein in need to update the formulae of multiple measures or dimensions in one go.


      Let's suppose I have two master measures having IDs x1 and x2 having formula as below:

      x1: Field1 + Field2

      x2: FIeld1 + Field3


      I need to replace Field1 with Field4 in both the measures.


      The steps I am following to update the measure using Engine API are as follows:

      1. CreateSessionObject

      2. GetLayout

      3. GetMeasure

      4. GetProperties

      5. SetProperties

      6. DestroySessionObject

      7. SaveChanges


      I am using a loop to iterate through these IDs and calling these methods in sequence.


      But the problem is that it updates the first Measure and not the subsequent one (receiving error: "{"jsonrpc":"2.0","id":0,"error":{"code":-32602,"parameter":"Invalid handle","message":"Invalid Params"}}").


      I couldn't figure out what is causing the issue.


      Any help would be greatly appreciated.