D365 Finance and Operations Archives - Page 14 of 24 - - Page 14

Category Archives: D365 Finance and Operations

Your connection is not private | NET::ERR_CERT_DATE_INVALID Error in D365 Finance and Operations

As seen in title when error “Your connection is not private | NET::ERR_CERT_DATE_INVALID” occured which seems as follows in screenshot when you try to open environment link in browser. The reason for above error in my case was that SSL certificate was expired as you can see in following screenshot To solve this issue go to your lcs.dynamics.com with your credentials and open your project now select which ever environment and visit see details/Full details page and click on maintain button and select  Rotate secrets button  Now click on Rotate SSL certificates after which dialogue box will appear click on yes  Now wait till rotating secret symbol is loading as following screenshot after which you will be able to access your D365 Finance and operation link easily. Hope this blog will help you.Thank you

Share Story :

Rest API GET call in JSON format in Dynamics 365 Finance and Operations

Introduction: In this blog, we will see how to get response from Rest Api through GET call Solution:  Consisting of basic authentication, we will pass username and password in byteStr and for the endpoint we will put it in url in below code. class CFSJSTestRestAPI { public static void main(Args _args) { int find; str url,aosUri,activeDirectoryTenant; str activeDirectoryClientAppId; str activeDirectoryClientAppSecret; str postData,activeDirectoryResource; str aadClientAppSecret,oAuthHeader; str returnValue,jsonString,jsondszstr; System.Net.HttpWebRequest request; System.Net.HttpWebResponse response; System.Byte[] byteArray; System.IO.Stream dataStream; System.IO.StreamReader streamRead; System.IO.StreamWriter streamWrite; System.Net.ServicePoint servicePoint; System.Net.ServicePointManager servicePointmgr; System.Net.HttpVersion version; CLRObject clrObj; Newtonsoft.Json.JsonReader reader; System.Text.Encoding utf8; Counter countCounter; Object obj; Map data; System.Byte[] byteArraynew; System.Net.WebHeaderCollection headers = new System.Net.WebHeaderCollection(); new InteropPermission(InteropKind::ClrInterop).assert(); str byteStr = strfmt(‘%1:%2’, “USERNAME”, “PASSWORD”); headers = new System.Net.WebHeaderCollection(); url = “http://dummy.restapiexample.com/api/v1/employees”; clrObj = System.Net.WebRequest::Create(url); request = clrObj; request.set_Method(“GET”); request.set_KeepAlive(true); request.set_ContentType(“application/json”); utf8 = System.Text.Encoding::get_UTF8(); byteArraynew = utf8.GetBytes(byteStr); byteStr = System.Convert::ToBase64String(byteArraynew); headers.Add(“Authorization”, ‘Basic ‘ + byteStr); request.set_Headers(headers); servicePoint = request.get_ServicePoint(); System.Net.ServicePointManager::set_Expect100Continue(false); System.Net.ServicePointManager::set_SecurityProtocol(System.Net.SecurityProtocolType::Tls12); response = request.GetResponse(); dataStream = response.GetResponseStream(); streamRead = new System.IO.StreamReader(dataStream); jsonString = streamRead.ReadToEnd(); info(strFmt(“RESPONSE: %1”,jsonString)); dataStream.Close(); response.Close(); } } Thanks for reading !!!

Share Story :

List of users for a security role | D365FO

Introduction: In this blog, we will see how we can get list of users who has assigned a specific security role   Solution:  UserInfo userInfo; SecurityRole securityRole; SecurityUserRole securityUserRole; while select networkAlias from userInfo where userInfo.networkAlias exists join securityUserRole where securityUserRole.User == userInfo.id exists join securityRole where securityRole.RecId == securityUserRole.SecurityRole && securityRole.Name == ‘Sales manager(NameOfTheSecurityRole)’ { info(userInfo.networkAlias); } Thanks for reading !!!

Share Story :

Table Browser Extension for Google Chrome | D365

Now table browser becomes much easier for Microsoft Dynamics 365 Finance and Operations. Here you go with Google Chrome Extension – Table browser caller for D365FO. It’s very easy to install and use it. After installing the extension to the browser, it appears on the top bar and looks like While clicking on the extension, You can find the tab named with config where you need to put the URL of the respective environment and save it. Once config is setup, you need to go to the main tab that is Table Browser Caller as shown in above figure where you would setup mainly:  Search for table name: name of the table Company Id: name of the legal entity  After that, you need to find the table in the search box and just press the Enter key. And you will be redirected to the table in the new tab.  In addition, Table browser has also few other features like Browse all table lists  Browse all data entities   1. For getting the list of tables you need to click on Table list: Result as,  2. For getting the list of data entities you need to click on Data entities:  Result as, 

Share Story :

Set form control access via security role in D365 Finance

In some of the cases instead of providing security to whole form we need it for particular form control.So this blog will help you with providing access to form control via security roles.If you want to know more about security roles you can use my previous blog . First of all we need form control where we need to set some of the properties as follows. In our case we are using laid off button as shownNow select the button and press F4 for its properties and set needed permision to manual as follows Now in your desired security privilege you can either directly set form control permissions or Entry Points.For form control permission method right click on form control permission and select new form and after that set name property to your desired form (Hcmworker in our case) as follows Now right click on your form and select New control option as follows and set control name and permission for it as follows For Entry point method you need first need to add new entry point and set its object type and object name properties or for existing ones select desired entry point and click on drop down arrow and on controls right click and select new control.And now set its grant and name properties to desired control and its access rights After this you need to assign this privilege in desired security role and security duty as previously discussed in security role blog

Share Story :

Create security role in D365 Finance and operation

In D365 Finance and Operations when you need to provide and restrict users from a certain operation you can make use of security roles. You can create security roles from Finance and operations environment itself or from its development tool i.e Visual Studio. In this blog, we are going to create a security role in Visual Studio as follows.   Create privilege    First of all we need to create privilege as follows now we need to add new entry point and set  object type in our case display menu item from properties Now add object name(display menu item  name) as follows   create role   Now we need to create role where above created privilege will be needed create new security role  as follows now we need to add new privilege in role as shown And from properties select privilege which we have created in previous step Create Duty   Now we have to create new duty and assign previously created privilege in its properties as shown Now we can see security role in FnO environment select any user from system administration>>users and click on assign role as follows and now search for priviously created role and click on Ok button now your security role is assigned to user with our role will be able to see the object like form, report etc except user with system administrator.  

Share Story :

Purchase order approval through a Mobile device in Microsoft D365 Fianance and Operations

In this blog I am going to explain in brief about  the Purchase order approval mobile workspace. This workspace lets you view purchase orders and respond to them through actions. For example, you can approve or reject a purchase order. After a purchase order (PO) has been created, it might have to go through an approval process. After the vendor has agreed to the order, the PO is set to a status of Confirmed. POs that don’t use change management have a status of Approved as soon as they are created. A PO creates inventory transactions only when it reaches the Approved status. Once you’ve activated the Change management, approval workflow is introduced. As a system administrator, you must publish the Purchase order approval mobile work space To do that Click Settings> Mobile app. Select the mobile workspace to publish. Click Publish Now on your mobile go to Playstore and download Microsoft Dynamics 365 Unified Operations App Once you have downloaded the App and logged in you should see the Purchase order approval workspace on your Mobile App  

Share Story :

x++ code to import data from excel to D365 FnO

We can also import data through code in D365 FO. Data import through code in D365 works differently than Ax2012 since cloud services.  Import Class we are trying to import data from Excel to D365FO through the following code.   using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; using OfficeOpenXml.ExcelRange;   class EmplAttendance { public void run() { this.updateDailyAttendance(); }   void updateDailyAttendance() { System.IO.Stream                     stream; ExcelSpreadsheetName            sheeet; FileUploadBuild                       fileUpload; DialogGroup                             dlgUploadGroup; FileUploadBuild                       fileUploadBuild; FormBuildControl                    formBuildControl; EmplAttendance_CFS              emplTimeAttendance, insertTimeAttendance, updateTimeAttendance; COMVariantType                     type; Dialog                      dialog =    new Dialog(“Daily Attendance Imported”);   dlgUploadGroup          = dialog.addGroup(“@SYS54759″); formBuildControl        = dialog.formBuildDesign().control(dlgUploadGroup.name()); fileUploadBuild           = formBuildControl.addControlEx(classstr(FileUpload), ‘Upload’); fileUploadBuild.style(FileUploadStyle::MinimalWithFilename); fileUploadBuild.fileTypesAccepted(‘.xlsx’);   str COMVariant2Str(COMVariant _cv) { switch (_cv.variantType()) { case COMVariantType::VT_BSTR: return _cv.bStr();   case COMVariantType::VT_EMPTY: return ”;   default: throw error(strfmt(“@SYS26908”, _cv.variantType())); } }   if (dialog.run() && dialog.closedOk()) { FileUpload fileUploadControl     = dialog.formRun().control(dialog.formRun().controlId(‘Upload’)); FileUploadTemporaryStorageResult fileUploadResult = fileUploadControl.getFileUploadResult();   if (fileUploadResult != null && fileUploadResult.getUploadStatus()) { stream = fileUploadResult.openResult();   using (ExcelPackage Package = new ExcelPackage(stream)) { int                         rowCount, i,columncount,j; Package.Load(stream); ExcelWorksheet   worksheet   = package.get_Workbook().get_Worksheets().get_Item(1); OfficeOpenXml.ExcelRange    range       = worksheet.Cells; rowCount           = (worksheet.Dimension.End.Row) – (worksheet.Dimension.Start.Row)  + 1; columncount      = (worksheet.Dimension.End.Column);     for (i = 2; i<= rowCount; i++) { str Emplid; TransDate                 WorkingDate; emplid                       = (range.get_Item(i, 1).value); WorkingDate            = str2Date((range.get_Item(i, 2).value),123);   select * from emplTimeAttendance where emplTimeAttendance.EmplId              = =  Emplid && emplTimeAttendance.WorkingDate       = =  WorkingDate;   if(emplTimeAttendance)     //if record already exists update it { emplTimeAttendance.selectForUpdate(true); emplTimeAttendance.Timein                          =   any2Str(range.get_Item(i, 3).value); emplTimeAttendance.Timeout                        =   any2Str(range.get_Item(i, 4).value); emplTimeAttendance.OT                                =  any2Real(range.get_Item(i, 5).value); ttsbegin; emplTimeAttendance.update(); ttscommit; } Else      //insert the new record { insertTimeAttendance.EmplId                         = (range.get_Item(i, 1).value); insertTimeAttendance.WorkingDate               = str2Date((range.get_Item(i, 2).value),123); insertTimeAttendance.Timein                         = any2Str(range.get_Item(i, 3).value); insertTimeAttendance.Timeout                       = any2Str(range.get_Item(i, 4).value); insertTimeAttendance.OT                                = any2Real(range.get_Item(i, 5).value); insertTimeAttendance.insert(); } } } } else { error(“Error here”); }   } }   public static void main (Args args) { EmplAttendance     emplDailyAttendanceImport;   emplDailyAttendanceImport = new EmplAttendance (); emplDailyAttendanceImport.run(); } }  

Share Story :

Customize Purchase order approval status

In the case of D365 Finance and Operations when you approve purchase requisition by default system creates Purchase order with approval status as “Approved” as follows     To change this default behavior of system such that once purchase requisition is approved the approval status of the purchase order as a draft you can use the following class class CFSPOStatus {     /// <summary>     ///     /// </summary>     /// <param name=”args”></param>     [PostHandlerFor(classStr(PurchAutoCreate_PurchReq), methodStr(PurchAutoCreate_PurchReq, endUpdate))]     public static void PurchAutoCreate_PurchReq_Post_endUpdate(XppPrePostArgs args)     {         //PurchTable  purchTable = args.getThis(‘purchTable’);         PurchAutoCreate_PurchReq purchReq = args.getThis() as PurchAutoCreate_PurchReq;         PurchTable  purchTable, purchTablenew;         purchTable = purchReq.parmPurchTable();         ttsbegin;         select forupdate purchTablenew where purchTableNew.PurchId == purchTable.PurchId;         if(purchTablenew && purchTablenew.DocumentState == VersioningDocumentState::Approved)         {             purchTablenew.DocumentState = VersioningDocumentState::Draft;             purchTablenew.update();         }         ttscommit;     } }and your final result looks like And after changing status you can apply your own purchase order workflow on it. For purchase order workflow you can refer to my blog

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 :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange