Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Dexterity Window Not Pulling in Vendor Name

Posted on by Microsoft Employee

Hello:

In Dexterity for GP 2013, I create a simple window to open, by clicking the "Additional" menu selection in Vendor Maintenance.  Below is my Startup script and my script for opening the form.

In addition to the Vendor ID, I have the Vendor Name as a field in this window.

The Vendor ID is pulling in fine, but the Vendor Name is not.

Can anyone think of a reason, as to why?

Thanks!

John

{}
local integer l_result;

l_result = Trigger_RegisterForm(form PM_Vendor_Maintenance,
         "Vendor Commodity",
         "l",
         script HR_Open_Vendor_Commodity);
if l_result <> SY_NOERR then
 warning "HR_Open_Vendor_Commodity Trigger Registration Failed " + str(l_result);
end if;

open form HR_Vendor_Commodity;
if isopen(window PM_Vendor_Maintenance of form PM_Vendor_Maintenance) then
 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity =
  'Vendor ID' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;
 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity =
  'Vendor ID' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;
  
 'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity;
 get table HR_Vendor_Commodity;
 if err() = OKAY then
  copy from table HR_Vendor_Commodity to window HR_Vendor_Commodity of form HR_Vendor_Commodity;
  
 end if;
end if;

*This post is locked for comments

  • Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Dexterity Window Not Pulling in Vendor Name

    I am glad to help, you are welcome. :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dexterity Window Not Pulling in Vendor Name

    That works perfectly, Almas!

    Thank you, so much!!!

    John

  • Verified answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Dexterity Window Not Pulling in Vendor Name

    try this

    release table  HR_Vendor_Commodity;
    'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity;
    change table HR_Vendor_Commodity;
    if err() = OKAY then 
    copy from window HR_Vendor_Commodity to table HR_Vendor_Commodity;	
    else
    copy from window HR_Vendor_Commodity to table HR_Vendor_Commodity;	
    end if;
    save table HR_Vendor_Commodity;
    close form HR_Vendor_Commodity;
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dexterity Window Not Pulling in Vendor Name

    Hi Almas:

    You're right.  I apologize, for forgetting to share the code for the "OK" button.  Here it is:

    'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID';

    change table HR_Vendor_Commodity;

    if err() = OKAY or err() = MISSING then

    'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID';

    save table HR_Vendor_Commodity;

    check error;

    end if;

    close form HR_Vendor_Commodity;

    Thank you, for helping me!

    John

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Dexterity Window Not Pulling in Vendor Name

    John,

    You haven't share your code, you are calling on 'OK Button'.

    In your code, you are reading values from your table

    copy from table HR_Vendor_Commodity to window HR_Vendor_Commodity of form HR_Vendor_Commodity;


    if data is not saved in your table for fields like user defined (and any other field on window) it will not show it on window. Please share your OK button code. It should have below piece of code to copy data into table.

     

    release table  HR_Vendor_Commodity;
    'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity;
    change table HR_Vendor_Commodity;
    if err() = OKAY then 
    	copy from window HR_Vendor_Commodity to table HR_Vendor_Commodity;	
    else
    	copy from window HR_Vendor_Commodity to table HR_Vendor_Commodity;	
    end if;
    save table HR_Vendor_Commodity;

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dexterity Window Not Pulling in Vendor Name

    Thanks, for this great information, Almas!

    When I opened my new window, the Vendor Name appeared.  But, I typed a value into a User Defined1 field that I had added to the window and clicked "OK".

    When I re-opened the window for the vendor, the vendor name did not appear and neither did the piece of data that I typed into User Defined1.

    Below is my revised script.  What am I doing wrong?

    Thanks, again!  Much appreciated!

    John

    open form HR_Vendor_Commodity;

    if isopen(window PM_Vendor_Maintenance of form PM_Vendor_Maintenance) then

    'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity =

    'Vendor ID' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;

    'Vendor Name' of window HR_Vendor_Commodity of form HR_Vendor_Commodity =

    'Vendor Name' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;

    'Vendor ID' of table HR_Vendor_Commodity = 'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity;

    get table HR_Vendor_Commodity;

    if err() = OKAY then

    copy from table HR_Vendor_Commodity to window HR_Vendor_Commodity of form HR_Vendor_Commodity;

    end if;

    end if;

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Dexterity Window Not Pulling in Vendor Name

    John, you are reading vendor id from PM_Vendor_Maintenance window, and showing in your window by reading from your table. First you need to save vendor id and vendor name with other details on your custom table and then when fetch next time read from your table.

    Why don't you set vendor name field just like you set vendor id filed from PM_Vendor_Maintenance window.

    if isopen(window PM_Vendor_Maintenance of form PM_Vendor_Maintenance) then
     'Vendor ID' of window HR_Vendor_Commodity of form HR_Vendor_Commodity = 
      'Vendor ID' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;
     ''Vendor Name'' of window HR_Vendor_Commodity of form HR_Vendor_Commodity =
      ''Vendor Name'' of window PM_Vendor_Maintenance of form PM_Vendor_Maintenance;

    ... rest of the code.

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans