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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Visual Studio SDK - Search a table

(0) ShareShare
ReportReport
Posted on by 150

HI,

I'm using the VS SDK, and cant work out how to search a table for a record.

As an example, I'm trying to get all the records in the Duos (SY90000) table that have the ObjectType='X' and the PropertyName='Y' regardless of whats in the other fields, in sql this would be:

"Select * from sy90000 where ObjectType='X' and PropertyName='Y'

Using the SDK i've got the following:

var duosTable = Dynamics.Tables.SyUserObjectStore;

duosTable.Key = 1;

duosTable.Clear();

duosTable.ObjectType.Value = "X";

duosTable.PropertyName.Value = "Y";                                

duosTable.RangeStart();

duosTable.Fill();

duosTable.ObjectType.Value = "X";

duosTable.PropertyName.Value = "Y";

duosTable.RangeEnd();

But this is returning all the records that have an ObjectType value of X, regardless of whats in the other fields.

Is what I'm after possable, and if so could someone point me in the right direction? I'm trying not to use sql to directly access the tables.

Thanks

Tim

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Steve Kubis Profile Picture
    Microsoft Employee on at

    I would suggest that you look at the Environmental Details sample that comes with the Visual Studio Tools SDK. It has a "DUOSHelper" source file that contains methods for accessing data in the DUOS table. You can look through the methods to see how the DUOS table is accessed if you want to know the details. It uses regular table access commands available in Visual Studio Tools.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans