1 Reply Latest reply: Oct 11, 2013 3:47 AM by SH RSS

    Using For loop in FDM Custom script

    user8452342

      Hi,

       

      I'm trying to create a FDM Custom script to fix a value for a specific dimention.

      Target: Planning

       

      Following is the script:

      Sub GCSENTITYTYPE(strField, srRecord)

      strGFR = DW.Utilities.fParseString(strRecord, 4, 1, "|")

      Dim Tel
      Dim Prof
      Dim Hubb
      Dim ctrl

      Ctrl= "0"

      Tel = Array("515", "542", "564", "566", "571", "573", "586", "589", "603", "629", "640", "643", "647", "653", "666", "702", "727)

      Prof = Array("575", "576", "786", "935", "969")

      Hubb = Array("633", "951", "2293", "2483")

      if Ctrl="0" then
      for each i in Tel
        if strGFR= Tel(i) then
         GCSENTITYTYPE= "TelCo"
         Ctrl="1"
         Exit for
        End if
      Next i
      end if

      if Ctrl="0" then
      for each j in Prof
        if strGFR= Prof(j) then
         GCSENTITYTYPE= "profserv"
         Ctrl="1"
         Exit for
        End if
      Next j
      end if

      if Ctrl="0" then
      for each k in Prof
        if strGFR= Prof(k) then
         GCSENTITYTYPE= "Hub"
         Ctrl="1"
         Exit for
        End if
      Next j
      end if

      End sub

      -------------------------------------------------------

      I'm facing several errors like :"Expected End of Statement at line:34"  which is Next i

      Please let me know how to use the loop and solve the issue.

      Thanks in advance.