web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Assistance with dexterity - Trying to create a script to trigger on a function

(1) ShareShare
ReportReport
Posted on by 1,484

Please help me to understand how to find/capture  the correct Function Name to register a script against.

I am trying to register a script based on a function that is running from the form RM Transaction Edit. I have read the IG guide and other PROG 1&II dexterity documentation. 

I understand the syntax

Trigger_RegisterFunction(function function_name {of form form_name}, attach_type, [function processing_function | script processing_procedure] {, tag})

The problem I encounter is how to correctly determine the function name (and correct syntax) to register in the Startup script.

First I create a script log and identify the function that I want to trigger.  I am pasting part of the script from the Receivables Transaction Edit screen.

'RM_Edit_Transaction Next Button - Window Area CHG on form RM_Edit_Transaction'
'RM_Edit_Transaction Browse Buttons CHG on form RM_Edit_Transaction'
'RM_PostedDocExistsInWork()', 0, "CREDT000000000001", 7, "XRM_Sales", "sa", 0
'IsRMCashReceipt()', 0, 7
'RM_Edit_Transaction RM Document Type-All CHG on form RM_Edit_Transaction'
'RM_Edit_Transaction Temp Control Number CHG on form RM_Edit_Transaction'
'ClearDocument of form RM_Edit_Transaction'
'RM_PostedDocExistsInWork()', 0, "CREDT000000000001", 7, "XRM_Sales", "sa", 0
'IsRMCashReceipt()', 0, 7
'MC_Is_MC_Transaction', "Z-US$", 0
'RM_Edit_Transaction RM Document Type-All CHG on form RM_Edit_Transaction'

I have also created a Profile script and can see which lines are P and which are F  (Procedures and Functions)

'RM_Edit_Transaction RM Document Type-All CHG on form RM_Edit_Transaction' is a Function

But no matter how I register it in Dexterity Startup, I am getting a syntax error.

The following is how I registered in Dexterity Startup


local integer l_result;

l_result = Trigger_RegisterFunction(function 'Document Type-All CHG' of form RM_Edit_Transaction, TRIGGER_AFTER_ORIGINAL, script Zint_RM_Edit_CMNo_FieldFocusTrigger);
if l_result <> SY_NOERR then
warning "The Zint_RM_Edit_CMNo_FieldFocusTrigger trigger is not registered.";
end if;

error message 

Unknown Identifer ''RM Document Type-All CHG'. (Line 42)

Type incompatibility 'Script Function Trigger_RegisterFunction, Parameter#1'. (line 42)

I have tried substituting RM_Edit_Transaction RM Document Type-All CHG for the fucntion name...)  similar error. 


local integer l_result;


l_result = Trigger_RegisterFunction(function 'RM Document Type-All CHG' of form RM_Edit_Transaction, TRIGGER_AFTER_ORIGINAL, script Zint_RM_Edit_CMNo_FieldFocusTrigger);
if l_result <> SY_NOERR then
warning "The Zint_RM_Edit_CMNo_FieldFocusTrigger trigger is not registered.";
end if;

Please advise

Categories:
I have the same question (0)
  • Verified answer
    Mike Bufano Profile Picture
    1,484 on at

    Sorry to be that person that answers there own question.....But I banged on this for 6 hours.

    finally figured out the syntax error.  The item I was trying to trigger on was not a function :(.

    THis worked....

    l_result = Trigger_RegisterFocus(anonymous('RM Document Type-All' of window RM_Edit_Transaction of form RM_Edit_Transaction),TRIGGER_FOCUS_CHANGE,

    TRIGGER_AFTER_ORIGINAL, script Zint_RM_Edit_CMNo_ScriptTrigger);

  • Suggested answer
    Derek Albaugh Profile Picture
    on at

    Thanks for the information Mike, I'm sure this will help others that run into this type of issue, and save them time as well.

    Have a great day.

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,095 Most Valuable Professional on at

    Hi Mike

    With functions and procedures you have two choices. Either match the parameters exactly or have no parameters.  Depends on whether you just want to know if the function or procedure was called, or if you want to know the parameters passed in.

    With function triggers, if there are no parameters, the handler is a procedure and the script keyword must be used when defining the handler. If you have the exact parameters, the handler will be a function and the function keyword must be used when defining the handler.

    With procedure triggers, the handler will always be a script regardless of whether parameters are passed.

    The script you are mention here is not a function or procedure, it is an focus event script. Focus events are the scripts associated with user interface objects such as forms, windows, scrolling windows and fields.  The handlers should be procedures with no parameters.  And you should use the Trigger_RegisterFocus() command.

    You can tell focus event scripts in the log because they have _CHG, _PRE, _POST, etc. suffixes to their names.

    FYI: If you are just starting with Dexterity you should look at winthropdc.wordpress.com/.../ and winthropdc.wordpress.com/.../

    Also look at GP Power Tools, which allows many of the customisation abilities of Dexterity, VBA, VSTools and SQL from inside the GP application.

    Regards

    David

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans