Posts

to fix reserved item in D365 FO x++ (Recalculate Inventory)

i mistakenly delete some SO line from sales order through SSMS but lines item are reserved . now what happened they do not going to unreserve  what i did is to delete related record from inventTrans and inventtransOrigin  than run the script below to fix it. Now it works.   static void InventSum_Recalculate(Args _args)   { InventSumRecalcItem InventSumRecalcItem; InventTable _InventTable; while select * from _InventTable where _InventTable.ItemId == 'DPID0000040' { ttsBegin; InventSumRecalcItem = new InventSumRecalcItem(_InventTable.ItemId, true, checkfix::fix); InventSumRecalcItem.updatenow(); ttsCommit; } info("Done"); }

Customize Invent On-hand Form and Add Batch related Display method on it in D365 FO x++

 [ExtensionOf(formDataSourceStr(InventOnhandItem, InventSum))] final class InventOnhandItem_InventSum_DSTWMSIntegration_Extension {     [SysClientCacheDataMethodAttribute(true)]     public  display TransDate batchExpDate_DSTWMS(InventSum _inventSum)     {                FormDataSource   InventDim_FDS    =   this.formRun().dataSource(formDataSourceStr(InventOnhandItem, InventDim));                  InventDim inventDimJoined = formJoinedRecord(_inventSum, InventDim_FDS);                  return InventBatch::find(inventDimJoined.inventBatchId,_inventSum.ItemId).expDate;     }     [SysClientCacheDataMethodAttribute(true)]     public  display TransDate batchBestBefore_DSTWMS(InventSum _inventSum)     {              ...

Product Dimension activation Check in D365 FO x++

     public boolean isProductDimensionActive(RecId _productRecId, RecId _EcoResProductDimensionAttributeRecId)     {              EcoResProductDimensionGroupProduct ecoResProductDimensionGroupProduct = EcoResProductDimensionGroupProduct::findByProduct(_productRecID);         EcoResProductDimensionAttribute ecoResProductDimensionAttribute = EcoResProductDimensionAttribute::find(_EcoResProductDimensionAttributeRecId);         FieldId dimFieldId = ecoResProductDimensionAttribute.getInventDimFieldId();         return EcoResProductDimGroupSetup::newDimensionGroup(ecoResProductDimensionGroupProduct.ProductDimensionGroup).getFieldSetup(dimFieldId).isActive();     } // calling the above method  select * from EcoResProductDimensionAttribute where EcoResProductDimensionAttribute.DimensionTableId == tableNum(EcoResFlavor);    if(this.isProductDimensionAct...

How to get FormRun in table Extension in D365 FO x++

              if(this.dataSource().formRun())             {                 DSCRUtil::refreshForm(this.dataSource().formRun());             }

Allow 'Data Inquiry' menu item to support more than 50 records in WMS D365 FO

  n warehouse device, if we have more than 50 containers for example, the system gives the error “ There are more results than displayed. Try applying a different filter "   Symptom : -'Data Inquiry' menu item doesn't support more than 50 records and no filtering is possible similar to 'Display open work list'. The following error is thrown: “There are more results than displayed. Try applying a different filter".   Resolution : -Apply one of the following three workarounds:   - Option 1 : Remove the * wildcard character value (with the objective not to retrieve all container types), or instead replace the query criteria with an actual value. Illustration on how it works can be seen in the attached video we have specifically prepared for demonstration.   - Option 2 : Configure multiple detours, for instance, one for big/large container group, one for small, and so on, to partition out the number of records displayed in each detour.   - Option 3 : Creat...

FormObservableLink works in data source extensions(refreshing display and edit methods )

  FormObservableLink class is useful for refreshing display and edit methods in D365FO. You create an instance variable of FormObservableLink type in a form, initialize it and call its observe() method in display/edit methods that you need to refresh on demand. When the refresh is required, you call markChanged() method of FormObservableLink and the system will rerun the methods and display new values. You can find more details in   AX 7. Display methods and Form Observability , for instance. I wondered if I can do the same in a data source extension and I wasn’t really sure that it would work. But it does – and the implementation is virtually the same as when building a whole form. Here is a simple example: [ ExtensionOf ( formDataSourceStr ( smmContactPerson , ContactPerson ) ) ] final class MySmmContactPerson_ContactPersonDs_Extension { // Declare and initalize FormObservableLink private FormObservableLink observableLink = new FormObservableLink ( ) ; ...

X++ Set One Of Financial Dimension Value to Empty

  [ExtensionOf(TableStr(TrvCashAdvance))] final class TrvCashAdvance_Extension { public void modifiedField(fieldId _fieldId) { next modifiedField(_fieldId); switch (_fieldId) { case(fieldnum(TrvCashAdvance, Worker)): this.updateDefaultDimension(); break; } } private void updateDefaultDimension() { HcmPersonnelNumberId hcmPersonnelNumberId; DimensionAttributeValueSetStorage dimStorage = new DimensionAttributeValueSetStorage(); DimensionAttribute dimAttribute; DimensionAttributeValue dimAttributeValue; DimensionDefault defaultDimension; #define.Worker('Worker') hcmPersonnelNumberId = this.Worker; defaultDimension = this.DefaultDimension; ttsBegin; dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension...