web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How to interpret the Flags column in SOP10100

(0) ShareShare
ReportReport
Posted on by

I think I have this figured out, but wanted to post here in case others are struggling with it as well.  The SOP10100 Flags column stores various on/off switches for the following settings of a sales document (order, invoice, etc.):

 1 = SOPFLAGS_ADDREDITED  (Address Edited)
 2 = SOPFLAGS_COMMENTEDITED (Comment Edited)
 3 = SOPFLAGS_PACKINGSLIPPRINTED (Packing Slip Printed)
 4 = SOPFLAGS_PICKINGTICKETPRINTED  (Picking Ticket Printed)

So here is how I was able to query whether the setting was active or not, using SQL server and the bitwise function (& position):

SELECT SOPNUMBE, Flags,
CASE WHEN Flags & 1 > 0 Then 1 Else 0 END AS Address_Modified,
CASE WHEN Flags & 2 > 0 Then 1 Else 0 END AS Comment_Modified,
CASE WHEN Flags & 3 > 0 Then 1 Else 0 END AS PackingSlip_Printed,

CASE WHEN Flags & 4 > 0 Then 1 Else 0 END AS PickingList_Printed

FROM SOP10100

WHERE NOT Flags=0

You could also search for documents that have a certain setting enabled, however it will be slow (table scan), so you should limit the results down in other ways first.

SELECT RTRIM(SOPNUMBE), Flags FROM SOP10100 WHERE SOPTYPE=2 Flags & 1 = 0 --Returns orders with non-modified addresses

SELECT RTRIM(SOPNUMBE), Flags FROM SOP10100 WHERE Flags & 3 > 0 --Returns orders with packing slips printed

Credit to these other posts helping to clarify this issue:

https://www.gpug.com/communities/community-home/digestviewer/viewthread?MessageKey=1ca488e2-dc6c-4490-8586-515466dba547&CommunityKey=4754a624-39c5-4458-8105-02b65a7e929e&tab=digestviewer

https://groups.google.com/forum/#!topic/microsoft.public.greatplains/InhOur9pMvk

https://improve.dk/converting-between-base-2-10-and-16-in-t-sql/ 

(Comments)

*This post is locked for comments

I have the same question (0)
  • Tim Wappat Profile Picture
    5,703 on at
    RE: How to interpret the Flags column in SOP10100

    Thanks for taking the time to post that information. Others searching in the future will no doubt find that valuable. 

    Tim.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans