Category Archives: Uncategorized

Develop Number Sequence for custom module In D365 Finance and Operations

In Finance and Operations system provide you unique number feature for new record that has been created known as Number Sequence.In most of the cases it is provided by system wherever it is necessary,and it also possible to use existing number sequence using environment only. When you create new module there you might need to setup new number sequence exclusive for that module.In such cases we might need to consider custom number sequence development,so in this blog we will see how to achieve that. In D365 Fo number sequence development is same as that of Ax 2012 but instead of over layering we have to achieve that using extension.Following diagram will help you to get overview of development. following are the steps which need to be performed and screenshots are also there for better understanding. Steps:- 1.       Create an extension of NumberSeqModule Base Enum and add a new element and name it with our Module name and label as well. 2.       Now create New EDT string with the name of PayId and set its properties as follows  3.       Now create parameter table and set its properties as follows and add key field to it       Set its property visible as no create new index and name it as keyIdx and add key field to it 4.       Now create another table where  number sequence is generated on its respective field of table in our case known as PayTable and field where number sequence will be applied is PayId 5.       Create new parameters form and apply table of contents pattern and add required elements(for reference you can use ProjParameters form) as follows Now to add second tab for number sequence setup.Since number sequence is complex for beginner you can simply copy NumberSeq tab of ProjParameters form and paste in Tab form control as follows 6.     Now create form where number sequence will be implemented where PayTable will be datasource and drag its fields to form as displayed. 7. Now add the class with name of NumberSeqModulePay and extend it with NumbeSeqApplicationModule and code for that as follows :- class NumberSeqModulePay extends NumberSeqApplicationModule{     /// <summary>    /// standard method for implementing new number sequence module    /// </summary>    /// <returns>NumberSeqModule value</returns>    public NumberSeqModule numberSeqModule()    {        return NumberSeqModule::Pay;//module name from NumberSeqModule enum extension    }     /// <summary>    /// standard method for implementing new number sequence module    /// sets up number sequences for module identifiers    /// </summary>    protected void loadModule()    {        NumberSeqDatatype datatype = NumberSeqDatatype::construct();        datatype.parmDatatypeId(extendedTypeNum(Payid));//EDT created in previous step        datatype.parmReferenceHelp(“Pay Id”);        datatype.parmWizardIsContinuous(false);        datatype.parmWizardIsManual(NoYes::No);        datatype.parmWizardIsChangeDownAllowed(NoYes::No);        datatype.parmWizardIsChangeUpAllowed(NoYes::No);        datatype.parmSortField(1);        datatype.parmWizardHighest(999999);         datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);        this.create(datatype);         // TODO: Add code for data types associated with the module    }     /// <summary>    /// event handler for implementing new number sequence module    /// adds the module to the global map    /// </summary>    /// <param name=”numberSeqModuleNamesMap”>global map for number sequence modules</param>    [SubscribesTo(classStr(NumberSeqGlobal), delegateStr(NumberSeqGlobal, buildModulesMapDelegate))]    public static void NumberSeqGlobal_buildModulesMapDelegate(Map numberSeqModuleNamesMap)    {        NumberSeqGlobal::addModuleToMap(classnum(NumberSeqModulePay), numberSeqModuleNamesMap);    }     public static NumberSequenceReference numRefPayId()    {        NumberSeqScope scope = NumberSeqScopeFactory::createDataAreaScope(curext());        return NumberSeqReference::findReference(extendedtypenum(PayId), scope);    } }this class  is used to provide number sequence setup parameters 8.       Now we need to load our number sequence to system for which create loadmodule classcode:-class loadmodulePay{       public static void main(Args _args)    {            NumberSeq PayNumSeq;        PayId payid;            ttsbegin;        PayNumSeq = NumberSeq::newGetNum(NumberSeqModulePay::numRefPayId());        payid = PayNumSeq.num();                     ttscommit;         Info(strFmt(“Payslip Id  is :%1 “,payid));    }} 9.       Add number sequence handler to form for that add following code to PayParameter form by selecting view code option on the form this    [Form]public class PayParameters extends FormRun{       #ISOCountryRegionCodes     boolean runExecuteDirect;    TmpIdRef tmpIdRef;     NumberSeqScope scope;    NumberSeqApplicationModule numberSeqApplicationModule;    container numberSequenceModules;       public void init()    {        this.numberSeqPreInit();        PayParameters::find();         super();        this.numberSeqPostInit();    }     void numberSeqPostInit()    {        numberSequenceReference_ds.object(fieldNum(NumberSequenceReference, AllowSameAs)).visible(numberSeqApplicationModule.sameAsActive());        referenceSameAsLabel.visible(numberSeqApplicationModule.sameAsActive());    }     void numberSeqPreInit()    {        runExecuteDirect = false;         numberSequenceModules = [NumberSeqModule::Pay];        numberSeqApplicationModule = new NumberSeqModulePay();        scope = NumberSeqScopeFactory::createDataAreaScope();        NumberSeqApplicationModule::createReferences(NumberSeqModule::Pay, scope);        tmpIdRef.setTmpData(NumberSequenceReference::configurationKeyTableMulti(numberSequenceModules));    }     public  NumberSeqModule numberSeqModule()    {        return NumberSeqModule::Pay;// module literal crated in NumberSeqModule enum extension previously     }     public Common resolveReference(FormReferenceControl _formReferenceControl)    {        NumberSequenceCode code = _formReferenceControl.filterValue(                AbsoluteFieldBinding::construct(fieldStr(NumberSequenceTable, NumberSequence),                tableStr(NumberSequenceTable))).value();         // Do not call super as we’re providing our own disambiguation logic.        // resolvedRecord = super(_formReferenceControl);         return NumberSequenceTable::findByNaturalKey(code, scope.getId(true));    }     public Common lookupReference(FormReferenceControl _formReferenceControl)    {        NumberSequenceTable selectedRecord;        SysReferenceTableLookup sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(NumberSequenceTable), _formReferenceControl, true);        Query lookupQuery;         // Do not call super as we’re providing our own custom lookup logic.        // selectedRecord = super(_formReferenceControl);         // Display the Title and Department fields in the lookup form.        sysTableLookup.addLookupfield(fieldNum(NumberSequenceTable, NumberSequence));         // Create a custom Query that filters on NumberSequenceScope.        lookupQuery = new Query();        lookupQuery.addDataSource(tableNum(NumberSequenceTable)).addRange(fieldNum(NumberSequenceTable, NumberSequenceScope)).value(queryValue(scope.getId(true)));        sysTableLookup.parmQuery(lookupQuery);         // Return the record selected by the user.        selectedRecord = sysTableLookup.performFormLookup();         return selectedRecord;    }     [DataSource]    class NumberSequenceReference    {        /// <summary>        ///        /// </summary>        void removeFilter()        {            runExecuteDirect = false;            numbersequenceReference_ds.executeQuery();        }         public display TaxBookSectionId taxBookSectionId(NumberSequenceReference _numberSequenceReference)    … Continue reading Develop Number Sequence for custom module In D365 Finance and Operations

Share Story :

How to delete old backup file automatically in SQL Server using Maintenance Plan

Posted On April 6, 2020 by Sandip Patel Posted in

There are different ways to delete old backup file, in this blog we will learn how to delete old backup file automatically in SQL Server Maintenance plan using the cleanup task. Step 1: Connect to the SQL Server, expand it and the Management folder after. Then right click on Maintenance Plans and click on Maintenance Plan Wizard. Step 2: In the Maintenance Plan Wizard, click Next Step 3: Enter a meaningful name and, optionally, a description, and in the bottom right click on Change.. Step 4: When the new job schedule window pops up, check if the Schedule type is set to Recurring. After that, we can set up the schedule using the option below. After that click OK. Step 5: Check if everything is correct before clicking on Next. Step 6: In the next window, check Maintenance Cleanup Task and click on Next. Step 7: In the following window, because we have only one task, there is no ordering, so we proceed by clicking on Next. Step 8: In the following window Under Delete files of the following type: we select Backup files by clicking on the radio button. Under File location: we select Search folder and delete files based on an extension. Under that, we specify where to search for the folders and what type of an extension to look for. Also, we can check the Include first-level subfolders option if the backups are stored in separate subfolders. Note : The file extension we input must not contain dot (ā€˜.’) – ā€˜.bak’ is incorrect, ā€˜bak’ is correct Under File age: we check the option Delete files based on the age of the file at task run time and specify the age of the files below After checking that everything is correct, we proceed by clicking Next: Here you have the list of time frame options like Hour(s), Day(s), Week(s), Month(s) and Year(s). You can select accordingly your requirements. Step 9: In the next window, we may select that a report is written and/or mailed to the email address we input every time the Maintenance plan runs. Step 10: In the next window we press Finish to complete the creation of our Maintenance Plan. After that we can check under Management -> Maintenance Plans for our newly created plan: Click on Finish button. Hope this helps!

Share Story :

Resolve the dependency between multiple solutions in D365 Customer Engagement / CRM Solution using Solution Component Mover.

You have might question in your mind that why we need to move the components from one solution to another solution in D365 Customer Engagement So, let’s consider a scenario you and your team is working on D365 CRM customization and created the two solution — ā€˜ Solution A’ and ā€˜Solution B’. While customization development when you are moving the ā€˜Solution A’ on the Production instance but you are not able to move it. Because some of the missing components are present in the ā€˜Solution B’. Then you have decided to move the ā€˜Solution B’ first, but again while moving the ā€˜Solution B’ its failed because of some of the missing components present in ā€˜Solution A’. It means ā€˜Solution A’ and ā€˜Solution B’ are dependent on each other and you can’t move either of the solutions in the Production Environment or Target Environment. There are two solutions to the above problem Add the missing components in the one solution and move that solution to production. Merge the dependent solution into one solution using Solution Component Mover. Now, the First solution is time-consuming as well as effort making and developers need to track all the missing components and add them manually. But using Solution Component Mover, you can merge solutions in 10 to 15 min just by selecting the component from Source Solution and Target solution to which you need to move the components. So, let us see how to do it. Perquisites: XrmToolBox You can download the XrmToolBox from https://www.xrmtoolbox.com/ Steps to follow: Open the XrmToolBox and connect to your D365 CRM environment. Search for the Plugin ā€œSolution Components Moverā€ Image: Search Solution Components Mover in XrmToolBox 3. Once the plugin will be load, click on load solution — it will load all the solutions present in the Environment. Image: Click on Load Solution After solutions are loaded you can see I have two solutions in my Environment ā€œSolution Aā€ and ā€œSolution Bā€ which have dependent components and one ā€œTarget Solutionā€ on which I m going to copy the component so that ā€œTarget Solutionā€ will become a master solution. Solution A Image: Solution A has Account entity and it’s subcomponents Solution B Image: Solution A has Case entity and it’s subcomponents Target Solution Image: Target Solution doesn’t have any entity or component. 4. Move the solution component by select the Source solution and Target Solution 5. Click on the Copy component, a popup will open where you can select the component type to move to the target solution. 6. Click on ā€œOkā€ and component from both solutions will be moved to Target Solution. You can see the following screenshot in which Target Solution has a component from ā€œSolution Aā€ and ā€œSolution Bā€. You can see XrmToolBox Plugin how it helps to reduce your time and effort to which are required to move the component from solution to solution manually one by one.

Share Story :

How to Reset Environment in CRM D365

  Introduction : In this blog, we will see how to reset CRM D365 Environment. Requirement of Client is Sales App but while installing Environment what if we installed all Apps ? Solution : We can reset the Environment. In this scenario, Our client requirement is only Sales App and we have installed all Apps. Step 1: Go to portal.office.com -> admin centre -> Dynamic 365 We will see that our environment is installed as Production and we don’t see option to reset the Environment. Step 2 : Now go to -> https://admin.powerplatform.microsoft.com/ -> Environments -> Select Environments -> Edit and make it as Sandbox and Save it. Once we Save, we can see Reset option. Step 3: Then click on RESET Step 4: When we click on the Reset, Form will be opened and we can see options to redeploy the Apps. Select Apps we want to redeploy. In our scenario, our requirement is Sales App only , we have selected only Sales App. Click on Reset and confirm. Result :   Hope this helps to view only those apps which you need !

Share Story :

How to connect Power BI to MySQL

In this blog we’ll see how to Connect Power BI to the MySQL . Before connecting to MySQL make sure you have MySQL connector install on your machine. Follow following steps to connect to the MySQL Open Power BI Desktop and select Get Data > Database > MySQL Database. For example, if you have a local MySQL server running and can connect to it by entering “localhost” or name of local machine, enter name of database and press OK button. If you are getting error saying “DataSource.Error: Object reference not set to an instance of an object.” To resolve this issue, go to File | Options and Settings | Data source settings and edit your data source and set the credentials to “Database credentials”, not Windows credentials.  You can get data from MySQL views, use the “SQL statement (optional)” and enter a SQL query. In next blog we’ll see how to connect the Power BI to MySQL if MySQL is running on the cloud.

Share Story :

Steps to Configure Environments through Life Cycle Services (LCS)

Configuration of Environment through LCS. After we purchase licence, Login the LCS through Admin account. You can see the follow link to complete setup environment. Before configuring the environments there are some pre-requisites need to be performed. Declaration of project milestone. Click on setup milestone, Enter the end date for each milestone and save. 2. VSTS Setup. Before this we need to follow the below steps: Login in Azure DevOps. Create a project. 3. Create personal access token. Save this token. Click on ā€œSetup Visual Studio Team Servicesā€ a.  Enter the site Enter the AzureDevOps url, which consists of https://organizationname.visualstudio.com/ and click on continue. Enter Personal access token generated above in Azure DevOps. b. Select the project Select the project from the list and click continue. c. Review and Save 3. Project configuration and project on-boarding. Click on ā€œComplete project configurationā€(This is one time setup) And click on ā€œProject onboardingā€ Check all the 12 points by clicking on next and then finish the complete onboarding review page. And click on configure button of environment Enter the name of environment and select the region. Then you can see the status of environment in queued state. After 7-8 hours you can login to your environment.      

Share Story :

Making SQL Server Accessible Over Internet

We can Make the SQL Server Accessible over Internet by following steps: 1. System should have static IP where SQL server is installed. 2. Open SSMS, right click on server > properties and check SQL Server and Windows Authentication mode 3. Go to Server > Security > Logins and configure password for users, who will be accessing the SQL server remotely. In this we are setting up password for the use ā€˜sa’. 4. Go to Server property and check  ā€œallow remote connections to this serverā€ 5. Go to SQL server configuration manager > SQL server network configuration > Protocols for SQL and make sure TCP/IP is enabled 6. Click on TCP/IP and enter port number in IPAll section 7. In firewall setting create Inbound rule for the port through which it will listen, in this case we are selecting port 4729   8. In next steps we will enable port forwarding (i.e. It will redirect request received on public IP and port to another IP and port combination) In mapped IP we can mention static IP of system also (i.e. 192.168.1.30) 9. Now from other system outside of current network, access the SQL server and enter server details and credentials. Enter server name eg 113.143.120.100, 4729\SQL Hope above Helps!    

Share Story :

How to Create Storage Account in Azure Portal

Hi, in this blog we will see how to create a storage account in azure portal. On the Azure portal menu, select All services. In the list of resources, type Storage Accounts. As you begin typing, the list filters based on your input. Select Storage Accounts. On the Storage Accounts window that appears, choose Add. Select the subscription in which to create the storage account. Under the Resource group field, select Create new. Enter a name for your new resource group, as shown in the following image. Select Review + Create to review your storage account settings and create the account. Hope this helps.

Share Story :

Conditional Formatting by Row in a Matrix

Introduction: This blog will show you how you can color individual rows differently based on different conditions and the row headers in matrix (Not alternating rows). Our Scenario: I want to apply colors to different rows of the following Buckets: Current – No Color 1-30 Days Past Due – Yellow 31-60 Days Past Due – Orange 61-90 Days Past Due – Red 91 or More Days Past Due – Red Step 1: Create a new calculated column in your data source which applies a numeric value to each header type that you would like to have highlighted. We have created a Calculated Column using the following query. Step 2: Select the Matrix to which you want to apply the formatting and go to conditional formatting section in the Format Tab and turn the Background Color Option ā€œOnā€. Step 3: The Conditional Formatting is applied for different fields in the Values section in the Matrix. So we will apply conditional formatting according to No.  field first. Select Format by ā€œRulesā€. In Based on field select ā€œSum of Color Columnā€ and in Summarization select ā€œSumā€. In the Rules section add the Rule as shown in the Screenshot.  Step 4: Apply the other rules for different colors same as above. Step 5: The Colors have been applied to different buckets according to our rule for ā€œNo.ā€ Column. Step 6: Repeat the same steps by selecting different fields from the drop down under Conditional Formatting, one by one. Step 7: Thus we have colored the different rows of the Matrix successfully based on our condition.

Share Story :

Trigger Power Automate on Condition

Introduction This blog explains how we can trigger Power Automate based on the required condition. Suppose you have a requirement where you want your flow should get trigger based on some condition then you can check condition on ā€œTriggerā€ itself rather than adding a new action to check condition. Use Case: Trigger flow when Lead is created and Lead Source Type is ā€œTrade Showā€ Trigger flow when Lead is created and Flag is ā€œYesā€. Trigger Flow when Lead is created, Lead Source Type is ā€œTrade Showā€ AND Flag is ā€œYesā€. Trigger Flow when Lead is created, Lead Source Type is ā€œTrade Showā€ OR Flag is ā€œYesā€.   Steps to be followed: Trigger flow when Lead is created and Lead Source Type is ā€œTrade Showā€ Click on Ellipsis (…) –> Click on Settings Go to Trigger Conditions and Click on ā€œ+Addā€ Add condition. @equals(triggerBody()?[‘leadsourcecode’],7) NOTE: ā€œLead Sourceā€ is an option set field add value of that option to check. After adding condition click on Done. Test your flow.   Trigger flow when Lead is created and Flag is ā€œYesā€. Repeat step number 1 to 3. NOTE: Flag is the ā€œTwo Optionā€ field for two option set fields use true or false in condition. @equals(triggerBody()?[‘cf_flag’],true)       Trigger Flow when Lead is created, Lead Source Type is ā€œTrade Showā€ AND Flag is ā€œYesā€. Repeat step number 1 to 3. AND Condition @and(equals(triggerBody()?[‘cf_flag’],true), equals(triggerBody()?[‘leadsourcecode’],7))   Trigger Flow when Lead is created, Lead Source Type is ā€œTrade Showā€ OR Flag is ā€œYesā€. Repeat step number 1 to 3. OR Condition @or(equals(triggerBody()?[‘cf_flag’],true), equals(triggerBody()?[‘leadsourcecode’],7))

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange