Get exceptions/requirements order by the screen displaying.

Questions about and code samples for automation process code snippets within Select.
Post Reply
tamar
Posts: 9
Joined: Wed Dec 14, 2022 4:52 pm

Get exceptions/requirements order by the screen displaying.

Post by tamar »

Hello.
I have to retrieve exceptions and requirements from the database according to the order and hierarchy they are displayed in the screen.
I cannot use Number field because there are items without number.
Any idea how to do this?

Thanks!
tamar
Posts: 9
Joined: Wed Dec 14, 2022 4:52 pm

Re: Get exceptions/requirements order by the screen displaying.

Post by tamar »

Any answer? LMK if the question is not clear...
Thanks!
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Get exceptions/requirements order by the screen displaying.

Post by BobRichards »

You can get exception/requirement information directly from the SQL tables. Remember to never write to the tables. This will not change the information in the order. Use this expression to experiment with. (Ignore the columns ending in the "@" character.)

This is all the available information. If the item doesn't hae a

Code: Select all

declare @orderNumber varchar(30) = '2023040008'
declare @rootID int = 
	(SELECT [RootID] FROM [pf].[Order] where Number = @orderNumber)

SELECT *
FROM [pfm].[Phrase] p
join [pf].[OrderItemType] oit -- Add Exception/Requirement types
on p.Type# = oit.ID
join [zref].[NumberedListFormat] nlf -- Add Number format
on p.NumberingScheme = nlf.ID
where RootId# = @rootID
If a numbering scheme is not set, you will have to get the ordering information directly from the order object.
Bob Richards, Senior Software Developer, SoftPro
tamar
Posts: 9
Joined: Wed Dec 14, 2022 4:52 pm

Re: Get exceptions/requirements order by the screen displaying.

Post by tamar »

This helped me. Thank you so much!
Post Reply