Internal - Division Order - Unlock DO from Discarded PPA Transfer
First, follow instructions on article Internal - Division Order - Discarded or Posted Division Order Records Don't Unlock. If the queries in those instructions return no data, but the Division Order still shows as locked, do the following steps. Division Orders will be referred to as “DO” in the instructions below.
📘 Instructions
In WEnergy, navigate to Division Order>Division Orders.
Search for the DO the client has an issue with.
If the DO cannot be checked out due to a transfer, the transfer number will appear at the top of the screen.
Note the transfer number.
Navigate to Division Order>Owner Transfers.
Search for the transfer number to make sure it does not exist in the grid.
If the number does exist in the grid, the lock is valid.
Let the client know they need to submit, approve, or discard the record to unlock the DO.
If the number does not exist in the grid, move onto the next steps.
In SSMS, run the attached query
The query will return Anchor IDs
In Excel insert each anchor ID from the query into the following statement where it says ANCHOR ID: CopiesUpstreamDivisionOrders.new.delete_do('ANCHOR ID')
An example of what this will look like:
CopiesUpstreamDivisionOrders.new.delete_do('fbfd8d68-4b97-44cc-a2a6-4e34653f5381')
CopiesUpstreamDivisionOrders.new.delete_do('386645f7-5535-4299-ae00-d5fc7acea1bb')
CopiesUpstreamDivisionOrders.new.delete_do('3d94226d-1c17-4b98-9281-57e266dc71cc')
Once all anchor IDs are entered into the statements, run RAILS on the Project environment.
Once the RAILS is complete, navigate back to Division Order>Division Orders and ensure the DO can be checked out.
Re-run the select script to ensure all anchor IDs were deleted
Follow usual procedures for TEST and PROD approval.
This is not how the system is designed to work. Once the issue is resolved in PROD, replicate the issue and move to code change.
QUERY FOR ANCHOR IDs:
--FIND AND REPLACE TRANSFER 10591 with your locking record number.
--THIS SCENARIO SHOULD ONLY OCCUR WITH TRANSFERS OR DO CHECK OUTS
--THE BELOW WILL ONLY FIX THE ISSUE IF IT IS A DISCARDED OR POSTED RECORD LOCKING THE DO
select distinct copy_name, number, anchor_id
from upstream_division_orders
where copy_name like '%transfer 10591%'