How to access a Third Party Table Buffer on a Cross Dictionary Procedure Trigger

Dave DusekThis particular situation has come up in a number of support incidents and I also run into this myself on occasion.  The situation is that you have a cross dictionary procedure or function trigger on a script and one of the parameters is a third party table buffer. 

According to KB Article 861788 Secure Link
, you can transfer third party table definitions into your own dictionary and then you have direct access to those table definitions.  However, that strategy does not work in the case of a table buffer parameter.  If you transferred the table definition into your own dictionary and then tried to access the table buffer in the trigger processing procedure, the table buffer would always be empty.  The issue is that your table has it's own buffer and is not using the buffer on the procedure/function.  The reason for this is because the resource id of the third party table in your dictionary doesn't match the resource id of the table in the third party dictionary. 

In this situation, instead of transferring the table definition, you need to change the table
buffer parameter to anonymous and then use the column function to access the data.  Now you
will be accessing the table buffer that is passed in the parameters list.

Example Dexterity Code - This is the trigger processing procedure on a cross dictionary procedure trigger. This is the correct way to access a third party table buffer:

 inout anonymous table Third_Party_Table;  {Add anonymous to the parameter}

local string myfield;

set myfield to column("Third Party Field") of table Third_Party_Table; 
 
{Use the column function to access the field data.  You do not need single quotes here.  
You can also use the column number as well instead of the field name.}

For more information on how to create a combined dictionary and working with Cross Dictionary Development see the following articles:

Cross Dictionary Dexterity Development

How to combine the Dynamics.dic core dictionary and an extracted dictionary by using Dexterity Utilities in Microsoft Dynamics GP (KB 930350) Secure Link

Dave Dusek
Dynamics GP Developer Support

// Copyright © Microsoft Corporation. All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, https://opensource.org/licenses/ms-pl.html.)