UDF Sourced from UDF in Header

SOLVED

Scenario, both udf's are in the SO_Header, new udf_prod (date field) that I am trying to update from an existing date field udf_allocated that is populated through a VI import.  I am trying to save a manual step of entering the date in udf_prod by sourcing from the udf_allocated, however, sometimes we might need to populate the udf_prod with a date and the VI import of the udf_allocated might not have a value.  In theory I am thinking the VI import of a blank udf_allocated would clear my udf_prod, so how could I avoid this, scripting or any other ideas?

Parents
  • 0

    Trying to make this simple, would just attaching a script on the UDF_ALLOCATED work?  And just look for that value and if no value do I need to add something to keep the UDF_DATE_PRODUCTION... field from changing.

    rVal = 0
    ALLOCATE = ""
    
    
    rVal = oBusObj.GetValue("UDF_ALLOCATED$", ALLOCATE)
    
    	If ALLOCATE = "Y" then
    	rVal = oBusObj.SetValue("UDF_DATE_PRODUCTION_RECEIVED$","UDF_ALLOCATED")
    
    	End if

  • +1 in reply to jland47
    verified answer

    Trial and error lead me to this answer, column pre-validate on the UDF_DATE_ALLOCATED

    If oSession.CompanyCode = "ACT" then
    
    rVal = 0
    ALLOCATE = ""
    
    rVal = oBusObj.GetValue("UDF_ALLOCATED$", ALLOCATE)
    
    	If ALLOCATE = "Y" then
    		
    		rVal = 0
    		pDATE = ""
    
    		rVal = oBusObj.GetValue("UDF_DATE_ALLOCATED$", pDATE)
    		rVal = oBusObj.SetValue("UDF_DATE_PRODUCTION_RECEIVED$", pDATE)
    
    	End if
    
    End if

  • 0 in reply to jland47

    Thanks for sharing your results!

Reply Children
No Data