Comment Line contains "xyz" - then UDF=Y Script

SOLVED

Is it possible to search within the SO Detail "Comment" field for a particular word to post-write a check mark in a UDF field?

Parents
  • 0

    A post-write script cannot change data on the record just written, but in a line post-write you should be able to update a header UDF.

  • 0 in reply to Kevin M

    if you use a pre-write script you should be able to change your udf.

    'pre-write so sales order detail
    
    rVal = 0
    commentString = ""
    searchString = "xyz"
    
    rVal = oBusObj.GetValue("CommentText$", commentString)
    
    If InStr(commentString, searchString) then
        rVal = oBusObj.SetValue("UDF_CheckBox$", "Y")
    End if

    I haven't tested this, but I think that should work.   Assuming the UDF is in the same detail record.

    E

Reply
  • 0 in reply to Kevin M

    if you use a pre-write script you should be able to change your udf.

    'pre-write so sales order detail
    
    rVal = 0
    commentString = ""
    searchString = "xyz"
    
    rVal = oBusObj.GetValue("CommentText$", commentString)
    
    If InStr(commentString, searchString) then
        rVal = oBusObj.SetValue("UDF_CheckBox$", "Y")
    End if

    I haven't tested this, but I think that should work.   Assuming the UDF is in the same detail record.

    E

Children