EONE BLOG

Tech Thursday : Extender Enterprise Pre Save Task


Have you ever needed the ability to stop a record from saving in Extender based on some criteria? You have, well so have we! We added the ability to Extender Enterprise 2016 (version 16.00.0030 and higher) and Extender Enterprise 2018.

While we cannot stop the save process of every process, we have added the ability to do a “Pre Save Record” task and set a global value to stop the save from continuing in any Extender window. In this example, we have a GL transaction and need to split out the distribution amount to additional categories. Think a poor man’s analytical accounting system.  We created an Extender window off the GL Transaction Entry Window to track the additional categories. I have a separate task to populate the Amount to Distribute when the extender window opens.

When I click save, I want the “Amount to Distribute” to match the “Amount” total at the bottom of the scrolling window. If the amounts match, then we can save the record. If the amounts do not match, then I do not want the user to be able to close the window without these being in balance.

 

We start by clicking the Action button on the Extender Window setup window.

Click Add


Select Pre Save Record event type, click add and select Run Dynamics GP Script

Enter a description, select the product of Extender.

Here is the code you would want to use as an example.

 

if Total of window ‘User Defined Window’ of form <#FORM_NAME#> <> <Amount To Distribute> then

  warning “Total must match”;

  ‘Abort Save’ of globals = true;

else

  ‘Abort Save’ of globals = false;

end if;

 

We need to set the ‘Abort Save’ of globals to true to stop the save from finishing. One thing to remember: always set the ‘Abort Save’ of globals to false when you want the save to continue or you could get yourself stuck in the extender window on save since the ‘Abort Save’ of globals was set to true if the Total did not equal the Amount To Distribute field. Once you get the amounts to match, the ‘Abort Save’ of globals would still be set to true since your code did not set it to false to continue the save. No need to cause yourself more pain than needed.

 

Happy Coding!

Leave a Comment




RECENT POSTS


Partners: Don't Call Me a Sponsor
Success Story Challenge Winner, Inovonics, Celebrates
Employee Spotlight: Introducing Luke Steckler - D365/CRM & Salesforce Channel Manager
Where Has All the Development Gone?
That's My Take: a SmartList Builder Interview with Steve Sieber from RSM

POPULAR POSTS


2016 SmartConnect Integration Bootcamps
Tech Tues: Automatically refreshing Pivot Tables in Excel Refreshable Reports
Happy Thanksgiving from the eOne team!
New Releases of Extender and SmartList Builder
2017 SmartConnect Integration Bootcamps

CATEGORIES

ARCHIVES

open all | close all

TAGS

#fargo CRM Demo Dynamics Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News eOne Spotlight ERP Events Excel Excel Report Builder Extender Extender Enterprise GP GPUG integration integration manager Meet the Team Microsoft Microsoft dynamics crm Microsoft Dynamics GP MSDYNGP Office Relationships partners release SalesForce SalesForce.com scripting SmartConnect SmartList SmartList Builder SmartList Designer SmartView SQL Support Tech Tuesday Templates training Zendesk

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.