Posts

Showing posts from September, 2023

Created By Me XDS Security Role

Image
Created By Me XDS Security Role 1. Enable Created by in the table 2. Create Simple Query  3. Create a Security Policy 4. Create a Security privilege  5. Create a Security Role

Create Lookup with group by through UIBuilder Class in D365fo x++

 Create Lookup with group by through UIBuilder Class in D365fo x++ Public class ClassUIBuilder extends SysOperationAutomaticUIBuilder {      ContracClass     _contract;     DialogField       DialogProcessCode;     public void build()     {         _contract = this.dataContractObject() as  ContracClass;                 // Create the dialog fields         DialogProcessCode   = this.addDialogField(methodStr( ContracClass, ParmItemId), _contract);              }     public void postBuild()     {         super();                 // Register lookup for Itemid Id field         DialogProcessCode.value('---');         DialogProcessCode = this.bindInfo().getDialogFiel...

Convert one currency to an other in D365fo x++

 Convert one currency to an other in D365fo x++   Code:  public real CurrentExchangeRate(CurrencyCode fromCurrency , CurrencyCode toCurrency , TransDate    transDate)     {           ExchangeRate           exchangeRate;         ExchangeRateType       ExchangeRateType;         ExchangeRateCurrencyPair   exchangeRateCurrencyPair;         real                   exchRate;           if( fromCurrency == toCurrency)         {             exchRate = 1;             return exchRate;         }   ...

Advance LookUp in D365fo x++

Advance LookUp in D365fo x++  internal final class ClsSysUserManagement_SalesTypes_EventHandlers {    static  SysLookupMultiSelectCtrl refLookupCtrl;          /// <summary>     ///     /// </summary>     /// <param name="sender"></param>     /// <param name="e"></param>     [FormControlEventHandler(formControlStr(SysUserManagement, CblSalesTypesSecurity_SalesTypesSelect), FormControlEventType::Lookup)]     public static void CblSalesTypesSecurity_SalesTypesSelect_OnLookup(FormControl sender, FormControlEventArgs e)     {         FormRun _formRun = sender.formRun();         FormDataSource              UserInfo_ds = sender.formRun().dataSource("UserInfo");         UserInfo                    userIn...

Lookup on item id with Different range

 Lookup of Item id with Different range [ExtensionOf(formStr(SalesTable))] final class CblClsSalesLineNotGarment_ItemId_Extension {          //init METHOD     public void init()     {         next init();         FormStringControl _Control = this.design().controlName(formControlStr(SalesTable, SalesLine_ItemId));         _Control.registerOverrideMethod(methodStr(FormDataObject, lookup), formMethodStr(SalesTable, overridenItemIDLookup));     }     //LookUp METHOD     public void overridenItemIDLookup(FormStringControl _formControl)     {         FormDataSource salesLine_ds = this.dataSource(formDataSourceStr(SalesTable,SalesLine));         SalesLine salesLine = salesLine_ds.cursor();         SalesTable salesTable;         BfpSalesType bfpSalesType;    ...

Filter Records on a form Through x++ EventHandler

Filter Records on a form Through x++ EventHandler   /// <summary>     /// This Event Handler is used to filtered out the Record on the base of Users     /// </summary>     /// <param name="sender"></param>     /// <param name="e"></param> [FormDataSourceEventHandler(formDataSourceStr(SalesTable, SalesTable), FormDataSourceEventType::QueryExecuting)]     public static void SalesTable_OnQueryExecuting(FormDataSource sender, FormDataSourceEventArgs e)     {                  CblSalesTypesSecurity       SalesTypesSecurity;         UserInfo                    userInfo;         boolean                     _flag = false;         FormRun         ...

How to Run Query Through Classes on d365fo x++

Image
Run Query Through Class  1. Add Base Enum      2. Add  Extended Data Types 3. Add These Two Classes SqlBrowser SQLHelper class SqlBrowser {     public static void Main(Args _args)     {         if(isSystemAdministrator())         {             Dialog Dialog = new Dialog("SQL");             DialogField querySelection = Dialog.addField(enumStr(QuerySelectionType),"SQL query Type");             DialogField queryInput = Dialog.addField(extendedTypeStr(QueryEdt),"SQL query");             //Note extendedTypeStr used is string EDT with memo string size i.e no restriction on how bug the query is                      Dialog.run();                      if(Dialog.closedOk() && que...