Scripting

Expand all | Collapse all

Is there a way to click into a UDF being validated

David Speck II

David Speck II12-19-2018 13:53

Phil McIntosh

Phil McIntosh12-21-2018 11:36

  • 1.  Is there a way to click into a UDF being validated

    Posted 12-19-2018 07:43
    Is there a way to click into a UDF being validated against a UDT from a script on a table pre-delete event? Customer wants to force a field to be populated in certain circumstances, and is not satisfied with a popup message and cancelling the delete - he wants the user to be confronted with the lookup to select from.


  • 2.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 08:26
    Let me see if i understand. 1. You have a UDF validated against a UDT. Assuming this is a multi-line with lookup? 2. Customer doesn't want a record to be deleted without first populating the UDF. 3. If the record is attempted to be deleted and UDF isn't populated, prevent the delete, and display lookup for UDF? Have you looked into the oUIObj.InvokeLookup? You should be able to use the oScript.SetErr to prevent the delete. It will be tricky getting timing right in order to cancel the delete in one script and trigger the lookup since i believe the SetErr isn't going to display until after the script has finished executing.


  • 3.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:19
    Hmmm...all the examples I can find of oUIObj in a script seem to indicate it just exists for you to call, but I get error 88 invalid/unknown propertyname Object Required 'oUIObj' on oUIObj.InvokeLookup(UDF_TEST$,sTest)


  • 4.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:22
    My bad, in a table script, you will need to check if `oScript.UIObj > 0`, if yes, then you can do `Set oUIObj = oSession.AsObject(oScript.UIObj)`. In a button or panel script, oUIObj is already set.


  • 5.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:38
    Is the lookup to invoke something other than the UDF name? I get a strange popup listing Control$, Mask$, etc but not what you get by clicking on the magnifying glass on the UDF in the screen.


  • 6.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:39
    And the oUiObj.LastErrorMSg is the infamous ""Cusotmer is not numeric"" but of unhelpfulness...


  • 7.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:42
      |   view attached
    Did you check the scripting.docx for that method? It says it accepts a lookup list name not a field name.


  • 8.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:52
    According to that it is only available from a button script...have you gotten it to work from a table script?


  • 9.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:53
      |   view attached
    See images.


  • 10.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 13:57
      |   view attached
    Just tested it from a post-read and post-load and it worked. The lookup name is case sensitive however so make sure you type it exactly as seen in the attached image.


  • 11.  RE: Is there a way to click into a UDF being validated

    Posted 12-19-2018 14:08
    Yes, the worst part of banging your head against a wall on something like this is finally having the answer except you typed it wrong... Thank you very much - you should write book on this!


  • 12.  RE: Is there a way to click into a UDF being validated

    Posted 12-20-2018 15:47
    At what point does the status change from New to Edit? Customer now doesn't wast to have to pick a reason code when he decides ""Oh I don't really need to create a quote for this after all.


  • 13.  RE: Is there a way to click into a UDF being validated

    Posted 12-21-2018 11:31
    If you are referring to the oBusObj.EditState property, i believe it is 2 when a new key is detected. once saved, if the same key is detected again, because the key exists, the EditState should be 1.


  • 14.  RE: Is there a way to click into a UDF being validated

    Posted 12-21-2018 11:36
    That's it - thanks!