What workflow action/ how can a script close a wor...
# manufacturing
p
What workflow action/ how can a script close a work order just like a UI Close button would? There is not field choice available for Status on WF
m
You cannot change the transaction status using WF. If you are trying to post a WO Close transaction then you Would need a script
p
its not a great solution. But setting the quantity to zero kinda works...
a
With a script you have to create a Work Order Close record and set the status to Closed on the Work Order.
nlapiTransformRecord('workorder',ID, 'workorderclose')
b
You actually can use a WF to close WIP WO’s. Its a scheduled transform action based on a saved search criteria.
p
You’re right with WIP, since WO Close is a different record. For non-wip, its a state on the WO record iteself, so not a transformation
a
@Bryan Miller - Can you provide more detail on the WF and how that is setup to close WIP WO's? I have a Saved Search that will work for the WO's that can be closed and am assuming you need to set that on the WF filter. Any more details would be appreciated.
p
Yea you can set that. Sounds like you’re looking to run it scheduled? I did based on a trigger. Basically you have to create a sublist group and within that make the action to check the Close (line) field thats not visible on the UI
a
What is your trigger if you go that route?
m
The close line field should be different than the WO close transaction. @Andrew Altringer To post a WO close you would use a scheduled workflow then put the transform record action as an entry trigger. In your transform record action choose work order close as the record type however I really don’t remember that ever being possible. From the documentation the work order close is not a record available to the transform action https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N2743016.html#:~:text=Use%20the%20Transform%20Record%20action,a%20transaction%20record%20life%20cycle.
Used the closed line field is not the same thing as a WO close
A WO close is a posting transaction that is the official end of a manufacturing process
a
@MGBC - Thank you. You are the WF expert to say the least. So your saying it is most likely not possible to close WO's with a WF? I was always under the impression that it was not possible which is why I was really interested to hear of a workable solution. I have only designed a script in the past to run on a schedule and close the WOs. You have to create the WO Close record in order for it to close correctly from what I remember.
p
I'd missed wip. For that, Transform action for the wip WO close can be explored
My use case was for non WIP, which I managed with a workflow too
b
I have a saved search hunting for work orders where built = quantity and this is the only action. It works reliably for WIP work orders. I haven’t tried anything for non-wip wo’s
Sorry for the delay, I closed slack lol
a
@Bryan Miller - Thank you for the follow up that is very interesting that will work and is great to know. Is there anyway to link the WF to a Saved Search instead of using the Parameters section of the WF Action? Ex. if you used the Saved Search Condition and picked a Search would it process the closed WO's? The only reason I ask is because I have a Search that has criteria to only display the Work Orders where Qty = Built Qty but on the line level also where the Components Qty = Built Qty. If you only use the Assembly (Header) Qty = Built Qty you could close WO's that have not been fully issued yet?
m
@Parth good to know, i guess the documentation I had was outdated, or maybe just not complete enough
@Andrew Altringer yes a schedule workflow will use the saved search you have built to process only the work orders that are in the results of the saved search
a
@MGBC - Do not feel bad...I was not aware this could be done with a WF either. I spent months looking for a solution when I was a NS Administrator and ended up going the scripting route.
m
Haha, thanks....I swear I tried to do this using WF a few years ago and it wasn't available so I had to make an M/R script for it as well. Haven't had to deal with it for awhile so maybe they updated something in the last year or so??🤷‍♂️ Probably just overlooked it myself...LOL
b
@Andrew Altringer I do use a saved search but not on the action - I use it on the workflow "header"(?) so the wf hunts for all matching records and then runs all actions inside of the wf.
@MGBC I'm not a dev - yet - lol , so I have to come up with creative ways to do these things myself
m
@Bryan Miller i agree I love to leverage workflows to their max and think outside the box. Great idea