Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Visual Studio SDK - Search a table

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

  • Suggested answer
    Steve Kubis Profile Picture
    Steve Kubis on at
    RE: Visual Studio SDK - Search a table

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans