How to resolve the WOs with specific prefixes A- and B-
I have a requirement like below.
I need to resolve the WOs with prefixes A- and B-. I have written an activity with obj browse on assign- WB and assign - WB got the WOs, did page merge and used pxForcecaseclose OOTB activity to close the cases. Now in input param, I have given A and B. So if A is selected WOs related to A prefix only should get closed, likewise if B is selected only B should get closed. What is the best approach to write logic to address this requirement?
Message was edited by: Kip Jackson
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
pxForcecaseclose seems to take a single work object as its parameter, but you said you gathered a list of assignment objects. Does one of the properties shown on each assignment object indicate the work object ? That's what you need to pass to pxForcecaseclose.
Also, pxForcecaseclose seems to be closing the case and all its sub cases. So, if multiple assignment objects in your list refer to the same case or its sub cases, you need to be careful to only call pxForcecaseclose for the work object, and only call it once for that work object.
One way you might consider doing this is, first sort your list of assignments by work object. That will make all assignments for a given work object contiguous in the list. Then, walk your list in an activity loop, and each time you encounter an assignment whose work object is DIFFERENT than for the previous assignment, and the prefix of that work object is your desired prefix, then call pxForcecaseclose else skip the call and walk to the next assignment on the list.
My requirement includes to close all assignments of each WO and then resolve the case.
Now I require help in this part.. I need to get only A- WO s n they shd get resolved if I select A in input params, likewise if I select only B- then only B WO s shd get resolved. How can I achieve this? How to write the logic?
Of course you can use Obj-Browse, but don't browse the Assign- elements, search for the Work- ones (with your prefix on pyID). The Main point from the message sent by Pankaj above is to use work objects and not the associated assignments. The pxForceCaseClose activity will handle the assignments closure automatically.
I have similar requirement we are calling the pxForceCaseClose activity in loop. when the list has 3 item which needs to be resolved, when 1st item is resolved it is vanishing all the data from the work table (assignments are deleted from the assign table) subsequent work objects are resolved, but data is not vanished. All this happening in the same loop.
Thank you for posting your query in the PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
You may also refer this discussion link as a reference in the new thread.