D365/AX7:Ledger/Financial Dimension Lookup In Form (Segmented Control)

Requirement

Ledger/Financial Dimension Lookup In Form (Segmented Control)

Steps

  1. Create 2 fields LedgerDimension (Int64) & AccountType (Enum-LedgerJournalACType) in table.
  2. Create a table relation of field LedgerDimension to DimensionAttributeValueCombination table.

Capture

 

3. Add fields LedgerDimension (Int64) & AccountType (Enum-LedgerJournalACType)             in form.

Capture.JPG

4. Change the properties of segmented control LedgerDimension:

– Auto declaration : Yes
– Account type field : AccountType
– Controller class : DimensionDynamicAccountController
– Filter expression : %1

5.Override the datasource’s field LedgerDimension modified() method

public void modified()
{
super();
SampleTest_LedgerDimension_ds.refresh();
}

6.Override the Form’s segment entry control LedgerDimension lookup() &                               checkUseCustomLookup() methods.

public boolean checkUseCustomLookup(int _accountTypeEnumValue, int _secondaryAccountTypeEnumValue)
{
boolean returnValue;

LedgerJournalACType accountType = any2Enum(_accountTypeEnumValue);
switch (accountType)
{
case LedgerJournalACType::Bank:
case LedgerJournalACType::Cust:
case LedgerJournalACType::FixedAssets:
case LedgerJournalACType::Project:
case LedgerJournalACType::Vend:
returnValue = true;
break;
default:
returnValue = false;
break;
}

return returnValue;
}

public void lookup()
{
switch (SampleTest_LedgerDimension.LedgerJournalACType)
{
case LedgerJournalACType::Bank:
BankAccountTable::lookupBankAccount(this);
break;
case LedgerJournalACType::Cust:
CustTable::lookupCustomer(this);
break;
case LedgerJournalACType::FixedAssets:
AssetTable::lookupAccountNum(this);
break;
case LedgerJournalACType::Vend:
VendTable::lookupVendor(this);
break;
default:
super();
break;
}
}

Capture

Cheers!

D365/AX7:Refresh caller Form DataSource from a class

Requirement

Refresh caller Form DataSource From a class

Sample Code

class AcxInventBarcodeMoveQuantity
{
static void main(Args args)
{
AcxInventBarcodePrinting inventBarcodePrinting;
FormDataSource formDataSource;
ItemId itemId;
;

inventBarcodePrinting = args.record();

if (inventBarcodePrinting.RecId && inventBarcodePrinting.PrintQty)
{
formDataSource = args.record().dataSource();
ttsbegin;
inventBarcodePrinting.selectForUpdate(true);
inventBarcodePrinting.MovedQty += inventBarcodePrinting.PrintQty;
inventBarcodePrinting.BalanceQty -= inventBarcodePrinting.PrintQty;
if (inventBarcodePrinting.BalanceQty == 0)
{
inventBarcodePrinting.BarcodeFilter = AcxBarcodeFilter::Printed;
}
inventBarcodePrinting.PrintQty = 0;
inventBarcodePrinting.doUpdate();
formDataSource.executeQuery();
 formDataSource.refresh();
formDataSource.allowEdit(true);
ttscommit;
info('Quantity Moved.');
}
}

}

D365/AX7:The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop: 7Zip failed to extract package Bin (LCS Package Deployment Failed)

Issue

Error coming at the time of LCS Package Deployment.Error code is….

The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop: 7Zip failed to extract package Bin

Resolution

  1. Navigate to folder J:\DeployablePackages OR K:\DeployablePackages OR C:\DeployablePackages and right click on the folder “DeployablePackages”.Untick the checkbox “Read-only” and click on “Apply” button.
  2. Navigate to folder J:\AosService\PackagesLocalDirectory\SystemHealth OR K:\AosService\PackagesLocalDirectory\SystemHealth OR C:\AosService\PackagesLocalDirectory\SystemHealth and right click on the folder “SystemHealth”.Untick the checkbox “Read-only” and click on “Apply” button.