Latest Updates

Convert Form To Page

agosto 20, 2023

Minimum version of NAV: 2009

Get Transfomation tool from the DVD installation folder \TransformationTool







Open Page 1770000

Click on Import FT-PT mapping
Import the FormToPagetypeMapping.txt file

Choose the form(s) wish to transform and "Get Forms"






Select Card






Transform Pages and the name must be "TransformPages.xml"


Export Form 21 from Object Designer as xml and name it "Forms.xml" save it in the same folder where you saved "TransformPages.xml" file.




Run Microsoft.Dynamics.Nav.Tools.FormTransformation.exe, it will generate 3 files








Finally import the Pages.xml file and compile it


Remote Synch Schema

agosto 26, 2020

Here is the script to synch remotely ...

#Important! Execute Enable-PSRemoting on every remote machine.

Porwershell
$Username = 'domain\user' #Domain admin user
$Password = '123456789'
#Create credential object

$SecurePassWord = ConvertTo-SecureString -AsPlainText $Password -Force
$Cred = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $Username, $SecurePassWord

foreach($line in [System.IO.File]::ReadLines("local path\hosts.txt")) #ip addresses list of the remote machines
{
  $line
  set-item wsman:\localhost\Client\TrustedHosts -value $line -Force
  #Create session object with this
  $Session = New-PSSession -ComputerName $line -credential $Cred
  #Invoke-Command
  $Script_Block = "remote path\SynchThis.ps1"  #This file is needed on every remote machine         
  $Script = $executioncontext.invokecommand.NewScriptBlock($Script_Block)                       
  $Job = Invoke-Command -Session $Session -Scriptblock $Script
  #Close Session
  Remove-PSSession -Session $Session
}
			

Remote Synch File

SynckThis.ps1


SHA-256 Signature

julio 17, 2020

Any client who has access to the name of an authorization rule and one of its signing keys can generate a SAS token. The token is generated by designing a string with the following format:
se: expiration time of the token. An integer that reflects the seconds elapsed since the 00:00:00 UTC time on January 1, 1970 (UNIX time) when the token expires.
skn: name of the authorization rule, which is the name of the SAS key.
sr: URI of the resource being accessed.
sig: signature.
The signature string is the SHA-256 hash calculated over the resource's URI (scope as described in the previous section) and the string representation of the token expiration time, separated by CRLF.
The hash calculation is similar to the following pseudocode and returns a hash value of 256 bits / 32 bytes.

SHA-256 ('https: // <yournamespace> .servicebus.windows.net /' + '\ n' + 1438205742)
The token contains the values ​​without the hash so that the recipient can recalculate the hash with the same parameters and verify that the issuer has a valid signing key.
The resource URI is the full URI of the Service Bus resource to which access is requested. For example, http: //.servicebus.windows.net/ or sb: // <namespace> .servicebus.windows.net / <entityPath>; that is, http://contoso.servicebus.windows.net/even

Cualquier cliente que tenga acceso al nombre de una regla de autorización y una de sus claves de firma puede generar un token de SAS. El token se genera diseñando una cadena con el siguiente formato:
se  : instante de expiración del token. Entero que refleja los segundos transcurridos desde la época 00:00:00 UTC el 1 de enero de 1970 (época de UNIX) cuando expira el token.
skn : nombre de la regla de autorización, que es el nombre de la clave SAS.
sr  : URI del recurso al que se accede.
sig : firma.
La cadena de firma es el hash SHA-256 calculado sobre el URI del recurso (ámbito tal y como se describe en la sección anterior) y la representación de cadenas del instante de expiración del token, separados por CRLF.
El cálculo del hash es similar al siguiente pseudocódigo y devuelve un valor de hash de 256 bits/32 bytes.

SHA-256('https://<yournamespace>.servicebus.windows.net/'+'\n'+ 1438205742)
El token contiene los valores sin el hash para que el destinatario pueda volver a calcular el hash con los mismos parámetros y verificar que el emisor posee una clave de firma válida.
El URI de recurso es el URI completo del recurso de Service Bus al que se solicita el acceso. Por ejemplo, http://.servicebus.windows.net/ o sb://<namespace>.servicebus.windows.net/<entityPath>;, es decir, http://contoso.servicebus.windows.net/even

PROCEDURE GetSignatureSHA256@1000000003(WebServiceURL@1000000001 : Text;pSharedKey@1000000000 : Text;VAR pSignature@1000000010 : Text;VAR pSignatureExpiration@1000000011 : Text);
    VAR
      ExpirySeconds@1000000002 : BigInteger;
      CRLF@1000000003 : Char;
      Crypto@1000000004 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Security.Cryptography.HMACSHA256";
      Encoding@1000000005 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Text.Encoding";
      Convert@1000000007 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Convert";
      TextToSign@1000000008 : Text;
      HttpUtility@1000000009 : DotNet "'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Web.HttpUtility";
    BEGIN
      CLEAR(pSignature);
      CLEAR(pSignatureExpiration);
      CRLF := 10;

      ExpirySeconds := ROUND((CURRENTDATETIME - CREATEDATETIME(010170D,000000T)) 1000,17200;  
      TextToSign := HttpUtility.UrlEncode(WebServiceURL+ FORMAT(CRLF+ FORMAT(ExpirySeconds);    

      Crypto := Crypto.HMACSHA256(Encoding.ASCII.GetBytes(pSharedKey));

      pSignatureExpiration := FORMAT(ExpirySeconds);
      pSignature := HttpUtility.UrlEncode(Convert.ToBase64String(Crypto.ComputeHash(Encoding.ASCII.GetBytes(TextToSign))));
    END;

Print N Copies in Report RDLC Dynamics NAV

julio 14, 2020
Reference Report 206

I have removed everything about page copying

SalesInvoiceNoLoop.txt

Adding a new DataItem as the fisrt one



And some code...



Send the var to the report...



Finally in the design we group by this variable



Here the result, you may compare both files

SalesInvoiceWithLoop.txt
 
Copyright © NiccoWeb Business Central / Dynamics NAV / Navision. Designed by OddThemes