Get technical name of the field from physical name in Dynamics GP using Dexterity

Sometimes Developers wants to find the technical name of the fields through the physical name. For this case, we can use the below two predefined functions to achieve the same.

1. Resource_GetResourceName

2. Resource_GetID

Resource_GetResourceName:

This function is used to get the resource name of the field. Before using this function we need to get the Resource ID for the particular field. So, use the second function Resource_GetID to get the resource id of the field and pass this value to this function as per below syntax.

Syntax:
Resource_GetResourceName(product_ID, resource_type, resource_ID)

Resource_GetID:

This function used to get the resource ID for the field. Get the resource id for the field as per below syntax and pass this value to the function Resource_GetResourceName.

Syntax:
Resource_GetID(product_ID, resource_type, resource_name)

Source Code:

The below code used to get the Technical Name of the field from the Physical Name of the particular Dictionary ID.

local string sFieldTechnicalName;

local integer dicID; 

local integer resID;

local string fieldPhyName;

dicID = 0; {pass your dictionary id number}

fieldPhyName = “TRXTYPE”; {pass your field physicalname}

resID = Resource_GetID(dicID , DT_SHORTNAME, fieldPhyName );

sFieldTechnicalName= Resource_GetResourceName(dicID ,  DT_FIELD, resID );

warning sFieldTechnicalName;

Hope this helps!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s