Timezone description | TimeZone | TZId |
---|---|---|
(GMT-12:00) International Date Line West | 24 | 24001 |
(GMT-11:00) Midway Island, Samoa | 65 | 65001 |
(GMT-10:00) Hawaii | 39 | 39001 |
(GMT-09:00) Alaska | 2 | 2001 |
(GMT-08:00) Pacific Time (US & Canada) | 58 | 58001 |
(GMT-08:00) Tijuana, Baja California | 59 | 59001 |
(GMT-07:00) Arizona | 75 | 75001 |
(GMT-07:00) Mountain Time (US & Canada) | 47 | 47001 |
(GMT-07:00) Chihuahua, La Paz, Mazatlan | 48 | 48001 |
(GMT-06:00) Central America | 15 | 15001 |
(GMT-06:00) Central Time (US & Canada) | 21 | 21001 |
(GMT-06:00) Guadalajara, Mexico City, Monterrey | 22 | 22001 |
(GMT-06:00) Saskatchewan | 11 | 11001 |
(GMT-05:00) Bogota, Lima, Quito, Rio Branco | 63 | 63001 |
(GMT-05:00) Eastern Time (US & Canada) | 29 | 29001 |
(GMT-05:00) Indiana (East) | 74 | 74001 |
(GMT-04:00) Atlantic Time (Canada) | 6 | 6001 |
(GMT-04:00) La Paz | 64 | 64001 |
(GMT-04:00) Manaus | 17 | 17001 |
(GMT-04:00) Santiago | 57 | 57001 |
(GMT-04:30) Caracas | 85 | 85001 |
(GMT-03:30) Newfoundland | 54 | 54001 |
(GMT-03:00) Brasilia | 28 | 28001 |
(GMT-03:00) Buenos Aires, Georgetown | 62 | 62001 |
(GMT-03:00) Greenland | 36 | 36001 |
(GMT-03:00) Montevideo | 83 | 83001 |
(GMT-02:00) Mid-Atlantic | 45 | 45001 |
(GMT-01:00) Azores | 10 | 10001 |
(GMT-01:00) Cape Verde Is. | 12 | 12001 |
(GMT) Casablanca, Monrovia, Reykjavik | 37 | 37001 |
(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, Londo | 35 | 35001 |
(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna | 79 | 79001 |
(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Pragu | 18 | 18001 |
(GMT+01:00) Brussels, Copenhagen, Madrid, Paris | 60 | 60001 |
(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb | 19 | 19001 |
(GMT+01:00) West Central Africa | 78 | 78001 |
(GMT+02:00) Amman | 43 | 43001 |
(GMT+02:00) Athens, Bucharest, Istanbul | 38 | 38001 |
(GMT+02:00) Beirut | 46 | 46001 |
(GMT+02:00) Minsk | 27 | 27001 |
(GMT+02:00) Cairo | 30 | 30001 |
(GMT+02:00) Harare, Pretoria | 68 | 68001 |
(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius | 33 | 33001 |
(GMT+02:00) Jerusalem | 42 | 42001 |
(GMT+02:00) Windhoek | 51 | 51001 |
(GMT+03:00) Baghdad | 5 | 5001 |
(GMT+03:00) Kuwait, Riyadh | 3 | 3001 |
(GMT+03:00) Moscow, St. Petersburg, Volgograd | 61 | 61001 |
(GMT+03:00) Nairobi | 25 | 25001 |
(GMT+03:00) Tbilisi | 34 | 34001 |
(GMT+03:30) Tehran | 41 | 41001 |
(GMT+04:00) Abu Dhabi, Muscat | 4 | 4001 |
(GMT+04:00) Baku | 9 | 9001 |
(GMT+04:00) Caucasus Standard Time | 84 | 84001 |
(GMT+04:00) Yerevan | 13 | 13001 |
(GMT+04:30) Kabul | 1 | 1001 |
(GMT+05:00) Ekaterinburg | 31 | 31001 |
(GMT+05:00) Islamabad, Karachi, Tashkent | 80 | 80001 |
(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi | 40 | 40001 |
(GMT+05:30) Sri Jayawardenepura | 69 | 69001 |
(GMT+05:45) Kathmandu | 52 | 52001 |
(GMT+06:00) Almaty, Novosibirsk | 50 | 50001 |
(GMT+06:00) Astana, Dhaka | 16 | 16001 |
(GMT+06:30) Yangon (Rangoon) | 49 | 49001 |
(GMT+07:00) Bangkok, Hanoi, Jakarta | 66 | 66001 |
(GMT+07:00) Krasnoyarsk | 56 | 56001 |
(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi | 23 | 23001 |
(GMT+08:00) Irkutsk, Ulaan Bataar | 55 | 55001 |
(GMT+08:00) Kuala Lumpur, Singapore | 67 | 67001 |
(GMT+08:00) Perth | 77 | 77001 |
(GMT+08:00) Taipei | 70 | 70001 |
(GMT+09:00) Osaka, Sapporo, Tokyo | 72 | 72001 |
(GMT+09:00) Seoul | 44 | 44001 |
(GMT+09:00) Yakutsk | 82 | 82001 |
(GMT+09:30) Adelaide | 14 | 14001 |
(GMT+09:30) Darwin | 7 | 7001 |
(GMT+10:00) Brisbane | 26 | 26001 |
(GMT+10:00) Canberra, Melbourne, Sydney | 8 | 8001 |
(GMT+10:00) Guam, Port Moresby | 81 | 81001 |
(GMT+10:00) Hobart | 71 | 71001 |
(GMT+10:00) Vladivostok | 76 | 76001 |
(GMT+11:00) Magadan, Solomon Is., New Caledonia | 20 | 20001 |
(GMT+12:00) Auckland, Wellington | 53 | 53001 |
(GMT+12:00) Fiji, Kamchatka, Marshall Is. | 32 | 32001 |
(GMT+13:00) Nuku’alofa | 73 | 73001 |
Friday, May 24, 2019
Timezone and TZId field in Dynamics
Tuesday, May 21, 2019
Multiselect lookup form control on D365 FO
//Event Handler code for Onlookup event
//Form Control with DS associate
FormControlCancelableSuperEventArgs event = e as FormControlCancelableSuperEventArgs;
FormDataSource fds;
FormControl fc = sender as FormControl;
fds = fc.formRun().Datasource(tableStr(<DS Name>));
FormRun fr = fc.formRun();
FormStringControl DummyrecIds = fr.design().controlName(formControlStr(<Form Name>, DummyRecIds)) as FormStringControl; //Create control on form and make it visible NO and Auto declaration yes. Its for dummy purpose
FormStringControl DummyStrIds = fr.design().controlName(formControlStr(<Form Name>, DummyStrIds)) as FormStringControl; //Create control on form and make it visible NO and Auto declaration yes.Its for dummy purpose
TableName tableBuffer= fds.cursor();
Query lookupQuery = new Query();
var selectField = [tableNum(<Table Name>), fieldNum(<Table Name>, <Field Name>)];
QueryBuildDataSource qbds= lookupQuery.addDataSource(tableNum(<Table Name>));
qbds.addSelectionField(fieldNum(<Table Name>, Name));
San_SyslookupMultiSelectGrid lookupLocation;
lookupLocation = new San_SyslookupMultiSelectGrid();
lookupLocation = San_SyslookupMultiSelectGrid::lookup(lookupQuery,
selectField,
sender,
DummyrecIds,
DummyStrIds, <Table Name>.<FieldName>);
<Table Name>.<FieldName> = lookupLocation.getSelectedStringsJoined();
event.CancelSuperCall(); //Cancel default lookup call on string control
//Event handler code end
//Lookup class
class San_SyslookupMultiSelectGrid extends SysLookupMultiSelectGrid
{
#SysOperation
private const str CollectionValueSeparator = #CollectionValueSeparator;
Public static San_SyslookupMultiSelectGrid lookup(Query _query, container _selectField, FormStringControl _callingCtrl, FormStringControl _recIdsControl, FormStringControl _strIdsControl, str _currentStrIds, queryRun _queryRun = null)
{
_strIdsControl.text(_currentStrIds);
_recIdsControl.text('');
var lookupMS = new San_SyslookupMultiSelectGrid();
lookupMS.parmCallingControl(_callingCtrl);
lookupMS.parmCallingControlId(_recIdsControl);
lookupMS.parmCallingControlStr(_strIdsControl);
lookupMS.parmQuery(_query);
lookupMS.parmQueryRun(_queryRun);
lookupMS.parmSelectField(_selectField);
lookupMS.run();
return lookupMS;
}
Public container getSelectedStrings()
{
return selectedStr;
}
Public SysLookupMultiSelectValues getSelectedStringsJoined()
{
return SysOperationHelper::convertMultiSelectedValueString(selectedStr);
}
Public static boolean stringListContainsItem(str _stringList, str _possibleItem)
{
container items = str2con(_stringList, CollectionValueSeparator);
for (int i = 1 ; i <= conLen(items) ; i++)
{
str item = conPeek(items, i);
if (item == _possibleItem)
{
return true;
}
}
return false;
}
}
//Multi select lookup with Form Control without DS
FormRun fr = sender.formRun() as FormRun;
Query query = new Query();
QueryBuildDataSource qbd;
TableId multiSelectTableNum = tableNum(ForecastModel);
container selectedFields = [multiSelectTableNum, fieldName2id(multiSelectTableNum, fieldStr(ForecastModel, ModelId))];
qbd = query.addDataSource(tableNum(ForecastModel));
qbd.addSelectionField(fieldNum(ForecastModel, ModelId));
qbd.fields().dynamic(NoYes::No);
qbd.fields().clearFieldList();
qbd.fields().addField(fieldNum(ForecastModel, ModelId));
qbd.fields().addField(fieldNum(ForecastModel, Txt));
SysLookupMultiSelectCtrl::constructWithQuery(fr, sender, query, false, selectedFields);
Tuesday, May 14, 2019
Save file to AZURE blob storage account in D365 FO
using BlobStorage = Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.Dynamics.AX.Framework.FileManagement;
using Microsoft.Azure;
using fileShareStorage = Microsoft.WindowsAzure.Storage.File;
/// <summary>
/// Class Saving File to Azure Storage contianer Blob or file share folder
/// </summary>
class SONFileToAzureStorage
{
NoYes IsSuccess;
public Str accountName;
public Str accountKey;
/// <summary>
/// Get /set Operation completion status
/// </summary>
/// <param name = "_IsSuccess">setting Operational current status</param>
/// <returns>operational Status</returns>
public NoYes parmOperationSuccess(NoYes _IsSuccess = IsSuccess)
{
IsSuccess = _IsSuccess;
return IsSuccess;
}
/// <summary>
/// Get /set Operation completion status
/// </summary>
public void initialize()
{
accountName = "";// TODO - Need to map
accountKey = "";// TODO - Need to Map
}
/// <summary>
/// Method will execute code to save file to Azure storage folders based current system setup
/// </summary>
/// <param name = "_fileName">Getting file name to process in to Azure storage</param>
/// <param name = "_fileContent">Get total fiel count to process</param>
/// <param name = "_containerName">Get specific azure container to process
/// <param name = "_fileFormat">Get specific file format to process
/// </param>
public void saveFileInAzureBlobStorage(str _fileName,str _fileContent,Str _containerName, Str _fileFormat)
{
System.Exception ex;
try
{
TextStreamIo file = TextStreamIo::constructForWrite();
container mainContainer;
mainContainer = conNull();
mainContainer = conIns(mainContainer,1,_fileContent);
file.writeExp(mainContainer);
str filetemppath = File::SendFileToTempStore(file.getStream(),_fileName);
System.IO.Stream fileStream = File::UseFileFromURL(filetemppath);
var storageCredentials = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(accountName, accountKey);
BlobStorage.CloudStorageAccount storageAccount = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true);
if (storageAccount)
{
fileShareStorage.CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
fileShareStorage.CloudFileShare share = fileClient.GetShareReference(_containerName);
//Create container in blob if not exists
// var blobcli = storageAccount.CreateCloudBlobClient();
//Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer cont = blobcli.GetContainerReference("from-d365")
if (!share.Exists(null, null))
{
throw error(strFmt("@SSY:AzureFileShareIsMissing",_containerName));
}
fileShareStorage.CloudFileDirectory cloudDir = share.GetRootDirectoryReference();
fileShareStorage.CloudFile fileToSave = cloudDir.GetFileReference(_fileName);
try
{
fileToSave.UploadFromStreamAsync(fileStream,null,null,null);
info(strFmt("@SSY:FilePlacedInAzure",_fileName));
this.parmOperationSuccess(NoYes::Yes);
}
catch(Exception::Error)
{
ex = CLRInterop::getLastException();
error(ex.ToString());
//info("@SSY:ErrorWhileUploadingFileInAzureBlobStoarge");
}
Catch(Exception::Warning)
{
ex = CLRInterop::getLastException();
warning(ex.ToString());
}
Catch(Exception::CLRError)
{
ex = CLRInterop::getLastException();
checkFailed(ex.ToString());
}
}
else
{
info("@SSY:ErrorInAzureStorageAccount");
}
}
catch(Exception::Error)
{
ex = CLRInterop::getLastException();
error(ex.ToString());
//info("@SSY:ErrorWhileUploadingFileInAzureBlobStoarge");
}
Catch(Exception::Warning)
{
ex = CLRInterop::getLastException();
warning(ex.ToString());
}
Catch(Exception::CLRError)
{
ex = CLRInterop::getLastException();
checkFailed(ex.ToString());
}
}
public static SONFileToAzureStorage construct()
{
return new SONFileToAzureStorage();
}
}
//Test
Static void Man(Args _args)
{
//TODO. Map Account Name and Account key
SONFileToAzureStorage azureStorage;
azureStorage = new SONFileToAzureStorage();
azureStorage.Intialize();
azureStorage.saveFileInAzureBlobStorage("Test.txt","Blob file content","TestCon",".txt");
if(azureStorage.parmOperationSuccess())
{
//File placed in to specified folder
}
}
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.Dynamics.AX.Framework.FileManagement;
using Microsoft.Azure;
using fileShareStorage = Microsoft.WindowsAzure.Storage.File;
/// <summary>
/// Class Saving File to Azure Storage contianer Blob or file share folder
/// </summary>
class SONFileToAzureStorage
{
NoYes IsSuccess;
public Str accountName;
public Str accountKey;
/// <summary>
/// Get /set Operation completion status
/// </summary>
/// <param name = "_IsSuccess">setting Operational current status</param>
/// <returns>operational Status</returns>
public NoYes parmOperationSuccess(NoYes _IsSuccess = IsSuccess)
{
IsSuccess = _IsSuccess;
return IsSuccess;
}
/// <summary>
/// Get /set Operation completion status
/// </summary>
public void initialize()
{
accountName = "";// TODO - Need to map
accountKey = "";// TODO - Need to Map
}
/// <summary>
/// Method will execute code to save file to Azure storage folders based current system setup
/// </summary>
/// <param name = "_fileName">Getting file name to process in to Azure storage</param>
/// <param name = "_fileContent">Get total fiel count to process</param>
/// <param name = "_containerName">Get specific azure container to process
/// <param name = "_fileFormat">Get specific file format to process
/// </param>
public void saveFileInAzureBlobStorage(str _fileName,str _fileContent,Str _containerName, Str _fileFormat)
{
System.Exception ex;
try
{
TextStreamIo file = TextStreamIo::constructForWrite();
container mainContainer;
mainContainer = conNull();
mainContainer = conIns(mainContainer,1,_fileContent);
file.writeExp(mainContainer);
str filetemppath = File::SendFileToTempStore(file.getStream(),_fileName);
System.IO.Stream fileStream = File::UseFileFromURL(filetemppath);
var storageCredentials = new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(accountName, accountKey);
BlobStorage.CloudStorageAccount storageAccount = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(storageCredentials, true);
if (storageAccount)
{
fileShareStorage.CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
fileShareStorage.CloudFileShare share = fileClient.GetShareReference(_containerName);
//Create container in blob if not exists
// var blobcli = storageAccount.CreateCloudBlobClient();
//Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer cont = blobcli.GetContainerReference("from-d365")
if (!share.Exists(null, null))
{
throw error(strFmt("@SSY:AzureFileShareIsMissing",_containerName));
}
fileShareStorage.CloudFileDirectory cloudDir = share.GetRootDirectoryReference();
fileShareStorage.CloudFile fileToSave = cloudDir.GetFileReference(_fileName);
try
{
fileToSave.UploadFromStreamAsync(fileStream,null,null,null);
info(strFmt("@SSY:FilePlacedInAzure",_fileName));
this.parmOperationSuccess(NoYes::Yes);
}
catch(Exception::Error)
{
ex = CLRInterop::getLastException();
error(ex.ToString());
//info("@SSY:ErrorWhileUploadingFileInAzureBlobStoarge");
}
Catch(Exception::Warning)
{
ex = CLRInterop::getLastException();
warning(ex.ToString());
}
Catch(Exception::CLRError)
{
ex = CLRInterop::getLastException();
checkFailed(ex.ToString());
}
}
else
{
info("@SSY:ErrorInAzureStorageAccount");
}
}
catch(Exception::Error)
{
ex = CLRInterop::getLastException();
error(ex.ToString());
//info("@SSY:ErrorWhileUploadingFileInAzureBlobStoarge");
}
Catch(Exception::Warning)
{
ex = CLRInterop::getLastException();
warning(ex.ToString());
}
Catch(Exception::CLRError)
{
ex = CLRInterop::getLastException();
checkFailed(ex.ToString());
}
}
public static SONFileToAzureStorage construct()
{
return new SONFileToAzureStorage();
}
}
//Test
Static void Man(Args _args)
{
//TODO. Map Account Name and Account key
SONFileToAzureStorage azureStorage;
azureStorage = new SONFileToAzureStorage();
azureStorage.Intialize();
azureStorage.saveFileInAzureBlobStorage("Test.txt","Blob file content","TestCon",".txt");
if(azureStorage.parmOperationSuccess())
{
//File placed in to specified folder
}
}
Monday, May 13, 2019
Get Instance of Class in EventHander method D365
[PostHandlerFor(classStr(TestCustomDP), methodstr(TestCustomDP, processReport))]
public static void getTmpTablePostHandler(XppPrePostArgs arguments)
{
TestCustomDP getDpInstance = arguments.getThis() as TestCustomDP;
TestCustomTmp tmpTable = getDpInstance.getTmpTestCustomTmp();
ttsbegin; while select forUpdate tmpTable { // TODO - write your own business logic } ttscommit; }
ttsbegin; while select forUpdate tmpTable { // TODO - write your own business logic } ttscommit; }
Subscribe to:
Posts (Atom)
Convert Call stack to readable format in D365FO X++
//Input --container _xppCallStack = xSession::xppCallStack(); Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...
-
Restore .bacpac file to Development VM Steps: 1. Take Backup of AxDB database from Development VM 2. Open Command Pr...
-
Posting Vendor invoice based on Product receipt public void postPurchaseInvoiceJournal() { VendPackingSlipJour vendP...
-
Code for reserve and unreserved sales order lines Inputs : SalesLine, InventDim (Combination to reserve), Qty Note : To Reserve -> Pass...