Extensible Data Security (XDS) – It is a framework that allows developers or system administrator to provide Data Security in D365 Finance and Operations.
Policy Or Security Policy – Policy is your main technical AOT artifact or element which is used to achieve Extensible Data Security (XDS).
Constrained table – Table/tables in a given security policy from which data is filtered or secured, based on the associated policy query. For example, Filtering Records in purchase order form (PurchTable) based on the primary table – VendGroup
Primary table – Primary Table is For example, Filtering Records in purchase order form (PurchTable) based on the primary table – VendGroup.
Policy query –Query of Primary table which is used to filter records from constrained tables.
Requirement
In D365 Fins & Ops, customer has one customised table – UserSetup with fields – UserId & InventSiteId where customer is maintaining user-wise records along with Site code.
Filtering Site master (InventSiteId) lookup values on the basis of site code which is predefined in user setup of current user.
Steps
Create a query of usersetup table.
Create a new security policy as per screens below:
The CAR Customization Analysis Report is a Microsoft Excel report.This report contains details of your customizations & artifacts, extension models, best practices issues, errors & warnings.
[code language = “cpp”]
****** Run the below command in cmd ******
xppbp.exe -metadata=<local packages folder> -all -model=<ModelName> -xmlLog=C:\BPCheckLogcd.xml -module=<PackageName> -car=<reportlocation>
For example
xppbp.exe -metadata=C:\Packages -all -model=”MyAppSuiteCustomizations” -xmlLog=C:\temp\BPCheckLogcd.xml -module=”ApplicationSuite” -car=c:\temp\CAReport.xlsx
********The xppbp.exe tool is located in c:\packages\bin or I:\AosService\PackagesLocalDirectory\bin ********
In standard D365 Finance & Operation, you can manually select the transactions to settle, or Microsoft Dynamics AX/D365 FO can select the transactions automatically by using the automatic settlement functionality. You can enable this feature by selecting the Automatic settlement check box in the Accounts receivable Or Accounts payable parameters form.But the customer/Client wants the same functionality of automatic settlement vendor-wise & customer-wise.
Sample Code
1 enum field is provided in customer and vendor master. Values of enum is Manual Settlement (1) & Automatic Settlement (2).
[code language = “cpp”]
[ExtensionOf(classStr(OffsetVoucher))]
final class ACPLOffsetVoucher_Extension
protected boolean skipMarkTransaction(CustVendTrans _custVendTransCredit, CustVendTrans _custVendTransDebit, boolean _areBillingClassificationsEnabled, boolean _isRestricted)
{
boolean ret = next skipMarkTransaction(_custVendTransCredit, _custVendTransDebit, _areBillingClassificationsEnabled, _isRestricted);
if (_custVendTransCredit.tableId == tableNum(VendTrans))
{
if (VendTable::find(_custVendTransCredit.AccountNum).AcxSettlement == AcxSettlement::Manual)
{
ret = true;
}
}
else if (_custVendTransCredit.TableId == tableNum(CustTrans))
{
if (CustTable::find(_custVendTransCredit.AccountNum).AcxSettlement == AcxSettlement::Manual)
{
ret = true;
}
}
Microsoft Dynamics AX, Microsoft Dynamics 365 for Finance and Operations, D365 FO, Retail, SQL, Microsoft Power Apps, Microsoft Power BI, Microsoft Azure, Logic Apps, Microsoft Flow, Microsoft power automate, Microsoft Power Platform,.Net, X++, C#, Power BI DAX, Data Warehousing, Microsoft Analysis Services, SQL Server Reporting Services