another blog

Icon

About Microsoft Dynamics GP :-)

VSTools and database triggers.

In SanScript coding we have database triggers, Below is a detail of what database triggers are as explained in dexterity manuals.

Database triggers
Database triggers are activated by successful table operations, such as a record
begin read, saved, or deleted. The procedure that runs in response to a database
trigger has access to the same table buffer contents as the script that performed the
database operation.Database triggers are useful for maintaining referential integrity between records in
your application and related records in the accounting system. When Microsoft
Dynamics GP reads, saves or deletes a record, you can use a database trigger to
perform similar operations for a related table in your application.

 

While working with VSTools, one surely miss equivalent event in VSTools customization. The resources for which we  can register events are such as forms, windows,and fields. While working with custom tables to save additional information related to the any GP window, we need to make sure about the integrity of data, so if records get saved/delete in GP table it’s corresponding record must be save/delete from the custom table.

For a situation like that I register event trigger against  AddRecordDeletedRecord procedure.

 Microsoft.Dexterity.Applications.Dynamics.Procedures.AddRecordDeletedRecord.InvokeAfterOriginal += AddRecordDeletedRecord_InvokeAfterOriginal;

private void AddRecordDeletedRecord_InvokeAfterOriginal(object sender, AddRecordDeletedRecordProcedure.InvokeEventArgs e)
{
if ((e.inParam1 == “GL_TRX_HDR_WORK”) &&
(e.inParam2 == DynamicsModified.Forms.GlTransactionEntry.GlTransactionEntry.JournalEntry.Value.ToString()) &&
(e.inParam3 == 2) &&
(e.inParam4 == 0))
{
//delete record from custom table
}

}

This procedure gets call from many GP windows and on several time, so that’s why I added if condition to check if I am correctly removing the record.

 

Filed under: Dexterity Triggers, Dynamics GP, dynamics-gp, VSTools

Getting the current active window in Dexterity.

Using dexterity there is not a direct way of getting current active window information, but with set of available GP functions and triggers can make this task happen. Below I am sharing a trigger and function which can tell the active window name. Below code needs to be changed according to the needs of developer, I have hard-coded values just to give an idea of how it can be work. There is a good discussion regarding the same topic on below dynamics community link to understand different ways of getting active window information in dex and .net.

https://community.dynamics.com/gp/f/32/t/199211?pi53330=2#responses

 

local long l_result;

l_result = Trigger_RegisterFunctionByName(0,
“Security”, TRIGGER_BEFORE_ORIGINAL, function getResourceID_fun);

getResourceID_fun

function returns integer i;

inout integer dictid;
in integer resourcetype;
in integer resourceid;
optional inout string strValue;
optional in boolean bolValue;

warning Resource_GetResourceName(0, 2, resourceid);

 

 

 

 

Filed under: Dexterity Triggers, Dynamics GP, Uncategorized

Cross Dictionary Development.

https://evspakistan.wordpress.com/cross-dictionary-development/

 

 

Filed under: Dexterity Development, Dexterity Triggers, Dynamics GP, dynamics-gp, Uncategorized

Cross Dictionary Dexterity Development and DEX.DIC

I am sharing trigger we have talked about in David’s Blog, I have used it many years ago for DEX.DIC dictionary of Dynamics GP version 9.

local integer l_result;   

l_result = Trigger_RegisterFocusByName(1,”window ‘Screen Output’ of form ‘Reports Screen'”,

2,2,script YourScript);

if l_result SY_NOERR then

    warning str(l_result);

end if;

Syntax Trigger_RegisterFocusByName(product_ID, qualified_resource, focus_type,

attach_type, script processing_procedure {, tag})

  • Constant Values for focus_type

  1. TRIGGER_FOCUS_PRE             0
  2. TRIGGER_FOCUS_CHANGE     1
  3. TRIGGER_FOCUS_POST          2
  4. TRIGGER_FOCUS_PRINT         3
  5. TRIGGER_FOCUS_ACTIVATE   4
  6. TRIGGER_FOCUS_FILL            5
  7. TRIGGER_FOCUS_INSERT       6
  8. TRIGGER_FOCUS_DELETE      7
  •  Constant Values for attach_type

  1. TRIGGER_BEFORE_ORIGINAL  1
  2. TRIGGER_AFTER_ORIGINAL     2

http://blogs.msdn.com//b/developingfordynamicsgp/archive/2011/01/06/9916002.aspx

http://blogs.msdn.com/b/developingfordynamicsgp/archive/2008/07/24/cross-dictionary-dexterity-development.aspx?PageIndex=2#comments

Cross Dictionary Dexterity Development and DEX.DIC

Filed under: Dexterity Development, Dexterity Triggers, Dynamics GP, dynamics-gp, , , , ,

Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Enter your email address to follow this blog and receive notifications of new posts by email.

almas

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats

  • 7,879 hits

RSS dynamics-gp

  • VSTools and database triggers.
    In SanScript coding we have database triggers, Below is a detail of what database triggers are as explained in dexterity manuals. Database triggers Database triggers are activated by successful table operations, such as a record begin read, saved, or deleted. The procedure that runs in response to a database trigger has access to the same […]
    Almas
  • Getting the current active window in Dexterity.
    Using dexterity there is not a direct way of getting current active window information, but with set of available GP functions and triggers can make this task happen. Below I am sharing a trigger and function which can tell the active window name. Below code needs to be changed according to the needs of developer, […]
    Almas
  • Hints and Tips… On going Post
    This is on going post and points will be added from time to time. 🙂 .. with Field Level Security we can not restrict document access on Sales transaction entry Window. Means we can not make user to choose only ‘Invoices’ in SOP Type drop down. .. we can not add custom table in table […]
    Almas
  • Reversing the sort order of Receivable Transaction Inquiry – Customer by Document Date
    Last few months we got more request on changing sort orders of Inquiry windows and lookups and to cover them all in a one place I have been working on a small project which will provide a simple sorting without much effort. In Dynamics Community there was a post having similar situation, I have already […]
    Almas
  • Getting the current open window in .net GP Add In
    There are many ways of getting information of active window in GP, but it changes according to the developing tool we are working on. 1.Dexterity.(the best tool 🙂
    Almas
  • Not all RW_Function are meant for reports.
    There are lots of RW functions available in a report writer Calculated Field Definition window and almost all of them are so handy while working on report writer, but it is a matter of fact that some of them are not actually meant for report writer. Usually RW functions are associated with report writer and […]
    Almas
  • Dexterity Can Wait and Respond.
    https://evspakistan.wordpress.com/microsoft-dexterity-can-wait-respond/Filed under: Can i, Dexterity Development, Dynamics GP, dynamics-gp, Uncategorized Tagged: Delay, dexterity, Wait
    Almas
  • Cross Dictionary Development.
    https://evspakistan.wordpress.com/cross-dictionary-development/    Filed under: Dexterity Development, Dexterity Triggers, Dynamics GP, dynamics-gp, Uncategorized
    Almas
  • Calling Sales Document Numbers Lookup
    Often developers need to open available lookup on their custom form from dynamics GP.Sales Document Number lookup is a very common and much used lookup and every dynamics technical person needs to call it in once (or more) in their lifetime. 🙂 Dynamics GP SDK provide a prototype of coding on how to open various […]
    Almas
  • This datatype name is already in use.
    This datatype name is already in use.
    Almas
Coding Notes

Code, News, Tech & Stuff

Dynamics GP Builders & Reporting

How to use MS Dynamics SmartList Builder, Excel Report Builder and other Reporting tools to get the data and analysis you need.

%d bloggers like this: