BUG?? Set the step description in Work Ticket Entry - The Description is greater than 30 character(s).

I'm using the line of code below, but I'm getting an error stating: "The Description is greater than 30 character(s)."  No doubt this is because the step description is stored in the JT_WorkTicketText table (much like the CI_ExtendedDescription table). 

Any ideas as to how to write to the full description to that step description while in the Work Ticket Entry screen?  Or is this functionality just missing from the BOI?


The script is running on JT_WorkTicket pre-write and the code is simply: 

sMessage = "0123456789-0123456789-0123456789-012345"

retval = oBusObj.SetValue("Description$", sMessage)

sMessage = "0123456789-0123456789-0123456789-012345"

retval = oBusObj.SetValue("Description$", sMessage)

Am I out of luck?

  • +1
    verified answer

    Per Scanco's dev team, this cannot be done via BOI. UI only, unfortunately. 

  • 0 in reply to n0tgunshy2

    Old and already resolved thread but I'd like to put this here for those who have the same issue.  We have Scanco's Production Management (ver 7.00.2).  Updating Text column of JT_WorkTicketText table is possible though BOI using JT_WorkTicketStep_Bus object, and the following function found in File Layouts and program info.  

    With that said, the function is limited and very much of a hack.   Using these functions, you don't need to put the row in edit state.  Just execute the code and it'll update. It's probably because this table isn't even exposed to VI and not directly accessible through any business objects. 

    FUNCTION LOCAL LoadStepText$(headerKey$, lineKey$)  
    FUNCTION LOCAL WriteStepText(StepText$, old.WorkTicketNo$, old.LineKey$)  

    LoadStepText  = reading

    WriteStepText = writing/updating

    HeaderKey$ = WorkTicketNo

    LineKey$ = StepLineKey

    Ignore, "old." reference.  

        Set oWtStep = oScript.NewObject("JT_WorkTicket_bus", oSS)
        
        Const sTicketNo As String = "000000000645"
        sText = oWtStep.oSteps.sLoadstepText(sTicketNo, "000001")
        Debug.Print "Old text was: " & sText
        retVal = oWtStep.oSteps.nWriteStepText("Revised Text!", sTicketNo, "000001")
        sText = oWtStep.oSteps.sLoadstepText(sTicketNo, "000001")

    Note that the above code utilizes JT_WorkTicket_Bus, and use oSteps instead of instantiating the object with JT_WorkTicketStep_Bus.  Both work the same. 

    I thought "LOCAL" methods were not available for BOI but evidently, some are available, perhaps that's because of Scanco's documentations issue though.