VSTS Token Expire on LCS


VSTS Token Expire on LCS



From last week, LCS was showing popup to me to change VSTS access token.. I was ignoring the prompt message and was focus with my daily task..



When ever popup prompt to me i Just click No. 

After sometime due to some technical reason I have to de-allocate my Build machine. When de-allocation process complete. I face a strange behavior that configure button of instance was grayed.




After spending hours of hours over internet, I believe that issue cause because of VSTS Access token expire... So i decide to Generate token again from VSTS..

following are the simple steps to generate token over lcs.

First login on VSTS project you can find the Project URL on LCS project setting.

Then click on Team services TAB.


Copy the URL address and paste over browser. then click on security icon.



Now click on add token from personal access token TAB.



Now fill the newly open form and click on generate 



An access token will appear to you, please copy and save in notepad file for future reference. it will no longer available to you again.


Now go to project setting and click on Visual studio team services.



Click on change Button

Enter the personal access token 



Now click on continue then next and then click on save...

Now go back to check your build machine configure button, it will be enable for you..







Support Faryal's Cusine


Bar Code in SSRS Report D365FO


Bar Code in SSRS Report D365FO


Following are the simple steps to generate Bar-Code in SSRS report.

In SSRS temporary table, Bar-Code filed should be extended with BarCodeString EDT.

Use font >BC C128 Narrow

Field in SSRS should be well space otherwise bar-code scan will not work

Using following code you can generate bar-code of any value...

Example: xyzTableBuffer.BarCodeField= this.getBarcode("123456789")


    public str getBarcode(str _barCodeText)
    {
        BarcodeCode128 barcode;

        barcode = Barcode::construct(BarcodeType::Code128);
        barcode.string(true, _barCodeText);
        barcode.encode();

        return barcode.barcodeStr();
    }



Please feel free to contact me if you are facing any issue during implementation of the blog

Support Faryal's Cusine


List of Tables Method X++





List of Tables Method X++




public class SLD_MethodList
{
   

    public static void main(Args _args)
    {
   
        SysDictMethod   sysDictMethod;
        SysDictTable sysDictTable;
        Set dictMethod;
         sysDictTable = new SysDictTable(tableName2Id('CustTable'));
         dictMethod = sysDictTable.methods(true, true, true);

         SetEnumerator enumerator = dictMethod.getEnumerator();

        while (enumerator.moveNext())
        {
            sysDictMethod = enumerator.current();
           
            info(sysDictMethod.name());
        }

    }
}

Support Faryal's Cusine


Edit Method D365FO





Edit Method D365FO




In AX 2009, when reference control was not available, in the table if there is a relation created on the basis of any field i.e. there is a child table and it contains the record Id of the parent Table. When that child table binds to form, (to display and select the user-friendly information from the parent table, lookup controls were used). The record Id of the user-friendly value is saved on the table with the help of the edit methods.

Here is the example to use Edit Method.



edit int ageUpdate(boolean _set, int value)
    {
        SLD_DemoTable _demoTable;
        int  ret;

        // find the car records from the car table with update = true
        _demoTable = SLD_DemoTable::find(this.Name, _set);

        if (_set)
        {
            ttsbegin;

            _demoTable.Age = value;
            _demoTable.update();

            ttscommit;
        }
        else
        {
            ret = _demoTable.Age;
        }

        return ret;
    }

Support Faryal's Cusine


Long Processing Dialog D365FO



Long Processing Dialog  D365FO

There is a class in Dynamics 365FO Named SysOperationSandbox which is handle long running dialog for long running processes.. this class support Class and table level static method only..

Following are the Parameters 


  • Class / Table name 
  • Method Name
  • Container
  • Caption Message
  • Completion Message
  • Failure Message 

Form Code

 [Form]
public class SLD_DemoForm extends FormRun
{
    [Control("Button")]
    class FormButtonControl1
    {
        /// <summary>
        ///
        /// </summary>
        public void clicked()
        {
            container _container=["You can pass parameter to your method",1000];
            SysOperationSandbox::callStaticMethod(classNum(SLD_DemoInstance),
            staticMethodStr(SLD_DemoInstance,LongProcess),_container,
            'waiting caption should be here', 'Operation completed message should be here','Operation Cancelled should be here');
            super();
        }

    }

}



Class Code

class SLD_DemoInstance
{





    public static void LongProcess(container _container)
    {
        int contervalue= conPeek(_container,2);

        for (int i=1;i <= contervalue;i++)
        {
            /// Your logic should here
            ///
        }

    }

}






Support Faryal's Cusine


Environment hot fixes D365FO


Environment hot fixes D365FO



In my previous blogs, I have shown that how to get the list of the hotfixes applied to your environment.


Previous blog Link 


Today, I decided to create a simple page on D365FO which will show you the list of the hotfixes installed on your environment.

As we all know we can view installed hotfixes only from Visual studio and we couldn't verify the environment where Visual studio was not installed. Line UAT and production.


You can download the solution from here.

To import this project please follow this blog.


How solution work.

After successful import of the project Go to Systems Administration > Steup > Installed Hotfixes

Reference screenshot



Now click on initiate process. this process will take time.

Reference screenshot


Once the process is complete all hot fixes will be visible to you like below.

Reference screenshot




Support Faryal's Cusine


Export & Import Project



Export & Import Project D365FO 



Today, We will talk about the good feature of Visual studio for D365FO & AX-7 is the Export & import Project.

Using this feature we can export all elements which are part of the solution including Module and their sub-model.

Following are a few simple steps.

Export Section

Step-1 Open Visual Studio and create a new project.
Step-2 Add some elements in the project and right-click on the project you will find the export option on the Menu option.

Reference Screenshot




Step-3 Provide the path where you want to save the Export project which will be in the form of *.axpp.

Reference Screenshot




Step-4 Now click on save.. export will take 2 to 3 minutes, exporting time duration vary on a number of the elements. 

Reference Screenshot



Import Section


Step-5 Now login to the instance where you want to import the project.
Step-6 Open Visual studio and Navigate to Dynamics 365 and click on import project.

Reference Screenshot



Step-7 When you click on import project, A popup will appear. provide the path of the project you want to import.

Reference Screenshot


Step-8 once the project is imported, the Visual studio shows the complete elements which are part of the project.

Reference Screenshot



Step-9 Click on the Ok button, Activity will take time because it will create module and sub-model if not exists in your environment and perform compile. You need to perform Database sync manually.

Step-10 Now navigate to the File menu and open the project. (You will find the recently imported project on the default path of Visual studio)


Reference Screenshot



Step-11 Now verify your all elements and check the model if it did not exist before import. In my case module and sub-model were not exists.

Reference Screenshot




Reference Screenshot





















Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...