Procedure to create a custom Cue based on a query and a normal field in Dynamics NAV - CloudFronts

Procedure to create a custom Cue based on a query and a normal field in Dynamics NAV

There’s no compelling reason to enter similar information again and again to different frameworks. At the point when you enter information into one framework, information naturally synchronizes to your different frameworks as characterized by your standards. Consider item data in NAV synchronizing to your webstore, online requests adjusting to NAV, and delivery and following information matching up to your webstore. Computerization spares you time since by dispensing with the requirement for you to enter information yourself. 

Another significant advantage of microsoft dynamics nav upgrade is that it improves your information quality. Your information won’t be inclined to human mix-up like mistakes and erroneous spellings. Coordination guarantees that quality information makes it to the entirety of your frameworks.

Introduction:

To show visual representation of aggregated data in Microsoft Dynamics NAV client, tiles are created in NAV which are called Cues. Cues are more user-friendly. It helps the user to get quick details of aggregated data like the total number of open sales orders, total number of customers with a particular status, etc.

Pre-Requisite:

Microsoft Dynamics NAV

Purpose:

In this article, I am going to demonstrate the procedure to create a custom Cue based on a query in Dynamics NAV. The scenario which I am going to elaborate is the numbers of contracts which is a custom entity repossessed in the current month.

Procedure:

    1. I have created a field ‘Status’ in my custom table ‘Contracts’ which is an option field which has the following OptionString ‘Created,Active,Terminated,Ended,Repossessed,Switched’. Now I am creating a cue to find the total number of contracts repossessed in the current month that means the total number of contracts for which status has been changed to ‘Repossessed’ in the current month.
    2. I have created two fields in ‘Contracts’ table viz. ‘Repossessed month’ and ‘Repossessed Year’ which will get populated with the Month name and the Year when the Contract status has been changed to ‘Repossessed’ respectively.

  1. The next step is to create a query. I have created a query ‘CF_RepossessedMonthQuery’ which will give the count of the total number of contracts repossessed in the current month.

    The result of the query is as follows:

  2. Now create a field in a new table which will store the count of the number of repossessed contracts in the current month.
    For this, I have created a new field in a table ‘RepossessedContractsMonth’ of DataType ‘Integer’ 
  3. Navigate to C/AL globals and create two new functions as below:  a. ‘ContractsRepossessedThisMonth’ with Return Value Name ‘CountContracts’ and ReturnType ‘Integer’ and the following local variables.

    Navigate to properties and set the local property of this function to ‘No’. Go to C/AL code and add the following code for this function:

    ‘DrillDownContractsRepossessedThisMonth’ with the following local variables: 

    Navigate to properties and set the local property of this function to ‘No’. Go to C/AL code and add the following code for this function:

    ‘DrillDownContractsRepossessedThisMonth’ is created so that on clicking the cue the respective records open in a list.

  4. The next page is to add the field created in step 4.
    Create a new group in a page with subtype ‘CueGroup’

  5. Go to C/AL code and in OnOpenPage() add the following code:
  6. In OnAfterGetRecord() add the following code:Assign the function created in step 5.a to the field added in the page ‘RepossessedContractsMonth’.

    In OnDrillDown() of RepossessedContractsMonth add the following code which will call the function created in step 5.b.

  7. Save the changes and run the page created in step 6. The output looks like below:
    On clicking the ‘Contracts Repossessed this Month’ Cue the 2 respective contracts are displayed whose status has been changed to ‘Repossessed’ in the current month.

    You can add these cues to any standard role center page like Business Manager Role Center, Sales Manager Role Center, etc.  so that the cues are visible when the user opens the NAV client.

Conclusion:

Using the above procedure, custom cues can be created in Dynamics NAV which will be displayed.


Share Story :

Secured By miniOrange