4 Replies Latest reply on Sep 23, 2010 11:18 PM by 795285

    Delete All Map Function

      Does anyone know the code to perform the delete all function for a particular mapping table? I am trying to include this in a custom script.
        • 1. Re: Delete All Map Function
          There is a function in the Object Browser for deleting mapping tables: API.SQLUpdateMgr.fDataMapDelete(strLoc, strDimName, blnDeleteEntireMap)
          • 2. Re: Delete All Map Function
            I tried various different methods to try and get that API to work in a Custom Web script, but I continue to get an error that says: Cannot use parentheses when calling a Sub. I'm very new to this, so I apoogize if this is a mundane question. Just trying to get this going. The user is looking for a way to pull their mappings from a SQL table, which I accomplished, but all maps for the dimension need to be deleted first, otherwise I get errors for duplicate values.
            • 3. Re: Delete All Map Function
              Sorry, I copied the code directly from the Object Browser. The parentheses are not necessary for this subroutine. The format should be like this:

              API.SQLUpdateMgr.fDataMapDelete "NorthAmerica", "Entity", False

              where "NlorthAmerica" is the location storing the map that you want to delete and "Entity" is the name of the dimension whose mapping table you want to delete. False indicates that you don't want to delete all of the dimension mapping tables for North America, just the Entity mapping table. Change this parameter to True if you indeed want to delete all mapping tables for the given location.

              Certain objects and their associated functions, subroutines, properties, etc., will not work in all script types. It may be the case that fDataMapDelete does not work in Custom Web scripts. I know that it works in Event scripts.

              The Object Browser in the FDM Workbench script editor is a good scripting reference and it is searchable. To search it, right click on the topmost folder and choose Search. Type in all or part of an object, function, or property name and hit OK. Scroll through the list to find the highlighted function, property, etc. that looks like it will work, click on it and you get the info on the item in the description window.

              The Accelerators in the Object Browser will copy entire snippets of code that you can use to carry out specific tasks.

              The API Guide explains all of this in more detail:
              1 person found this helpful
              • 4. Re: Delete All Map Function
                Thank you so much! That worked like a charm. I appreciate all of your help.