Monday, September 19, 2022

TFS | TF400324: Team Foundation services are not available | The underlying connection was closed

 Recently I found this interesting issue on one of my AX2012 Dev machine which connects basically to TFS. 









Problem's keywords

  • TF400324: Team Foundation services are not available
  • The underlying connection was closed


Solution

I found that these following instruction works for my case.

1.      Open up a PowerShell command prompt, running it with elevated privileges

2.      Run the following command for 64 bit applications:

# set strong cryptography on 64 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord 

3.      Run this command for 32 bit applications

# set strong cryptography on 32 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord 

4.      Reboot.



References

Thursday, April 14, 2022

X++ | AX2012 - Create a class name list lookup

This is almost the same thing as this post X++ | d365FO - Create a list of table name lookup, but in AX2012.


Thanks Muhammad Afsar Khan here as the original source code and idea comes from his post Display all/specific AOT tables in a lookup.


The overview processes are very similar to D365FO version, but now we don't need to create the temp table:

  1. Add a lookup method to the table that will be used as a form's data source
  2. Add a lookup method to the form control


1. Add a lookup method to the table that will be used as a form's data source



 public void lookupClassName(FormStringControl _control)  
 {  
   QueryBuildDataSource  qbds;  
   Query          q = new Query();  
   SysTableLookup     lookup = SysTableLookup::newParameters(tableNum(UtilidElements), _control, true);  
   qbds = q.addDataSource(tablenum(UtilidElements));  
   qbds.addRange(fieldnum(UtilidElements, recordType)).value(SysQuery::value(UtilElementType::Class));  
   //qbds.addRange(fieldnum(UtilidElements, name)).value(SysQuery::value("ABC*"));  
   //qbds.addSortField(fieldNum(UtilidElements, name), SortOrder::Ascending);  
   lookup.addLookupField(fieldnum(UtilidElements, Name), true);  
   lookup.parmQuery(q);  
   lookup.performFormLookup();  
 }  


2. Add a lookup method to the form control



 public void lookup()  
 {  
   //super();  
   [OurTableName].lookupClassName(this);  
 }  


Thanks for reading and until the next post!