Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

search records in a scrolling window

Posted on by Microsoft Employee

Hi created a new dexterity window with search box and the scrolling window

The search field in the scrolling window was index Non-Unique Index.

Can somebody tell me where I am making mistake because it is not select the record

if empty('(L) EmpSearch' of window EmployeeSearch) then

                 warning "Please select a record first.";

                else

                                set 'Frstname' of table EmpRate to '(L) EmpSearch';

                    get table EmpRate by number 1;

                                {run script field 'Redisplay Button' of window 'EMP_LOOKUP';}

                    fill window SCR_Employee from current by number 1;

                                focus 'Frstname' of window SCR_Employee  ;

                                run script field 'Redisplay Button' of window 'EMP_LOOKUP';

end if;

 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    Hi for empid i have used primary key and for Frstname i have index with Non-Unique Index

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    I am assuming you are pulling data from a table that you created?  What are the key segments for the table?  Do you have one created for the field you are trying ot get data by?

    Regards,

    Aaron

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    Hi,

    I have tried the following steps and still unable to fetch record.

    System by default is fetching the first record.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    Okay then, here's what I do and it seems to work (pretty similar to the IG programming guide that comes with dexterity).

     

    FIND BUTTON CHANGE EVENT

    run script field 'Redisplay Button' of window EmployeeSearch;

    REDISPLAY BUTTON CODE

    if empty('(L) EmpSearch') then

         warning "Please select a record first.";

    else

         Frstname of table EmpRate = substring('(L) EmpSearch', 1, 15);

         fill window SCR_Employee from current by number 1;

         focus field Frstname of window SCR_Employee;

    end if;

    Now, I use a sort by because I offer more than one way to sort/search for items in my lookups so hopefully this code will still run by defaulting the key to 1.

    Give this a try and let's see what happens.

    Aaron

     

        

     

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    For search I have provides new window with find push button on the change event of find button I have written the code

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: search records in a scrolling window

    Where does this code reside?  when I do a lookup or any kind of scrolling window with search, I put this code inside of a redisplay button, but I see you are calling it so I'm confused.  

    Aaron

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