2 Replies Latest reply on Nov 29, 2010 5:26 PM by mathieuc

    Setting up period control in FDM


      I have to set up a test on the period in FDM but I don't know how to do it simply... I have to check that the period in the file that the user is trying to import is the same that the current period of the location. If not I'd like to stop the import file process and retrieve an error message.

      Looking on the forum I tried to create a simple BefFileImport to stop the import process but it's not working...

           If strEventName="StartMapProcess" Then' StartMapProcess is a cancelable Event occurring after BefFileImport in the Import Event firing order
                RES.PcolScriptInfo.Item("ScriptInfo").ColFlds.Item("Cancel").varValue = True' Abort the remaining Import events
                API.MaintenanceMgr.mProcessLog strLoc, strCat, strPer, 1, False, "Import Errors", Now()' Set the Import status to failure
           End If

      Any idea ?
        • 1. Re: Setting up period control in FDM
          Hellp Mathieu,

          Unfortunately 'strEventName' are not valid unless they are in an 'action' ... as the actions contain such sub-events. Normal "Events" such as 'BefFileImport' do not contain such things.

          So the condition you are using "If strEventName" will never be true ...

          I would suggest you do a few things:
          1. Review the API Guide on OTN -- this will provide you what is valid for such events/actions
          2. Move your script (with more conditions) to the ImportAction

          Thank you,
          • 2. Re: Setting up period control in FDM
            Ok fine, I misunderstood a point in an other post... now it's fine.

            I can populate a variable in the BefFileImport script an then stop the importprocess in an ImportAction script. Thanks !!