Sage 100

 View Only
  • 1.  I Have a simple script to get data from a UDT - se

    Posted 11-27-2012 13:54
    I Have a simple script to get data from a UDT - sets the AsObject OK, but won't retrieve the record - external-access & security are on. UDT works as validation for other fields. Any ideas on this syntax? Failing on the final line: FIND. oSO_UDT_CLINICAL_TERRITORIES = oSession.GetObject(""CM_UDT_SVC"", ""SO_UDT_CLINICAL_TERRITORIES"") if oSO_UDT_CLINICAL_TERRITORIES <> 0 then SET oSO_UDT_CLINICAL_TERRITORIES = oScript.AsObject(oSO_UDT_CLINICAL_TERRITORIES) retVal = oSO_UDT_CLINICAL_TERRITORIES.FIND(Zip3)


  • 2.  RE: I Have a simple script to get data from a UDT - se

    Posted 11-27-2012 16:09
    There is nothing wrong with your code. Are you sure that your key field and Zip3 variable are compatible?


  • 3.  RE: I Have a simple script to get data from a UDT - se

    Posted 11-27-2012 18:17
    Exactly. If you don't initialize Zip3 to a string (Zip3 = """" ) then in VBS it is assumed to be numeric. If that's not the issue you can get the LastErrorMsg and put it in a MessageBox - something like this: msgRetVal = oSession.AsObject(oSession.UI).MessageBox("""",Find Error: "" & oSO_UDT_CLINICAL_TERRITORIES.LastErrorMsg() )


  • 4.  RE: I Have a simple script to get data from a UDT - se

    Posted 11-27-2012 19:23
    Yes I had the Zip3= """" prior to that section. UDT key is 3-char string also. ... puzzled ! I'll try the error-trap. Thanks.


  • 5.  RE: I Have a simple script to get data from a UDT - se

    Posted 11-29-2012 07:24
    Oddly enough, I changed the variable name from Zip3 to ZipPrefix and it worked. The UDT variable name was Zip3. ???


  • 6.  RE: I Have a simple script to get data from a UDT - se

    Posted 11-29-2012 09:48
    When something like that happens that makes absolutely no sense I reverse just that bit to double check the theory.