Customizing Dynamics NAV
Discover different ways to customize the application to give you and your colleagues access to the features, functionality, and data that you need most.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
The requirement was such that on click of the action button a payment transaction is done. The time at which transaction was done is stored in the database. A restriction shouldto be applied to disallow the customer to make payment for the same amount till a certain time
E.g. A transaction was done by customer A at 11.40 a.m for amount $100. This customer will be disallowed to make the transaction of the same amount $100 till suppose 5 mins. This time is mins will depend on the client requirement.
Microsoft Dynamics NAV 2017
EFTTransaction.SETRANGE("Sell-to Customer No.",Rec."Sell-to Customer No.");
EFTTransaction.SETRANGE("Account Number",Rec."Account Number");
EFTTransaction.SETRANGE("Transaction Amount",Rec."Transaction Amount");
EFTTransaction.SETRANGE("Transaction Status",EFTTransaction."Transaction Status"::Approved);
IF EFTTransaction.FINDLAST THEN BEGIN
//Code written to convert time to hr min and sec **ST**
Milliseconds := time1 - 000000T;
//MESSAGE('%1 total mili',Milliseconds);
Hours := Milliseconds DIV 1000 DIV 60 DIV 60;
Milliseconds -= Hours * 1000 * 60 * 60;
Minutes := Milliseconds DIV 1000 DIV 60;
Milliseconds -= Minutes * 1000 * 60;
Seconds := Milliseconds DIV 1000;
Milliseconds -= Seconds * 1000 ;
//Code written to convert time to hr min and sec **EN**
Minutes+="Rec_Sales&Rec"."Time Check for Credit Card(min";
Milliseconds+=Seconds*1000 +Minutes * 1000 * 60+Hours * 1000 * 60 * 60; //convert time to milliseconds
Milliseconds:=Milliseconds/1000; //convert milliseconds to seconds
tim := 000000T;
tim := tim + (Milliseconds MOD 60) * 1000; // get the seconds
Milliseconds := Milliseconds DIV 60; // keep the minutes
tim := tim + (Milliseconds MOD 60) * 1000 * 60; // get the minutes
Milliseconds := Milliseconds DIV 60; // keep the hours
tim := tim + (Milliseconds MOD 60) * 1000 * 60 * 60; // get the hours
IF (EFTTransaction."Transaction Date"=TODAY) AND (TIME < tim) THEN
ERROR('The Transaction for the account number %1 can be only done after %2 mins',Rec."Account Number","Rec_Sales&Rec"."Time Check for Credit Card(min")
Thus using the above logic time can be converted to Integer variables and then convert Integer variables to time again.
The post How to restrict an action button based on time in Microsoft Dynamics NAV appeared first on CloudFronts - Microsoft Dynamics 365 | Power BI | Azure.
Business Applications communities