Skip to main content

Posts

Showing posts with the label recid

Solved Error during Inventory Closing and Recalculation in Ax 2012

Getting following Error during Inventory Closing and Recalculation in Ax 2012. Error Details: "You can't have unallocated cost on a planning formula" Solution : This error may come many ways. First check the item in production type is formula or not, if not, change production type to formula. Then you can debug following method in class InventCostItemDim  \Classes\InventCostItemDim.addFormulaKeyAdjustment() To get any error due to rounding you can check ledgervouchertransobject class in checkrounding method. Then you can correct rounding issue. If still error exist then find the recid by debugging on error editing message and find that record in inventtrans table. If in inventtrans table valueopen field if its yes then select no this option you can use only if there is no other solution you found.

Query to get Tax Registration Number by party Name in Ax 2012

This is the Query to get Tax Registration Number by party Name in Ax 2012. Intermediate table for DirPartyTable and taxRegistration is DirPartyLocation and registrationNumber is the field to get value of tax registration Number. DirPartyTable DirPartyTable; DirPartyLocation DirPartyLocation; taxRegistration taxRegistration; select * from DirPartyTable where DirPartyTable.Name == "TestName"; select * from DirPartyLocation where DirPartyLocation.Party == dirPartyTable.RecId; select registrationNumber from taxRegistration where taxRegistration.DirPartyLocation == dirPartyLocation.RecId; info(strFmt("reg %1",taxRegistration.RegistrationNumber));

Relation between HcmPosition , HcmWorker and DirPartyTable in ax 2012

Relation between HcmPosition , HcmWorker and DirPartyTable in ax 2012  1.DirPartyTable is equivalnt to Dir Person and PersonId is present in HcmWorker Table and for worker Position there is HcmPositionWorkerAssingment table in which u will find the HcmWorker id n HcmPosition id. 2.there is no direct relation b/w HcmPosition and HcmWorker where the relation is made through HcmPositionWorkerAssignment as #Xainu said i.e HcmPositionWorkerAssignment .worker = HcmWorker.RecId, and for HcmWorker and DirPartyTable - RecId of DirPartyTable is nothing but person field in HcmWorker 3.For hcmworker and hxm position: hcmworker has relation with hcmpositionworkerassignment and hcmpositionworkerassignment has relation with hcmposition and hcmposition has with hcmposition detail. For dirpartytable abd hcmworker: dirpartytable has relation with dirperson and dirperson has relation with hcmworker.

Query to get workflow last comment in Ax 2012

I want to highlight Query to get workflow last comment in Ax 2012. You can use ,WorkflowTrackingTable,WorkflowTrackingStatusTable  and WorkflowTrackingCommentTable   to get Last comment entered by used on submitting or approving workflow for module WorkflowTrackingTable workflowTrackingTable; WorkflowTrackingStatusTable workflowTrackingStatusTable; WorkflowTrackingCommentTable workflowTrackingCommentTable; PurchTable PurchTable; select PurchTable where PurchTable.PurchId ="PO13000003"; select ContextCompanyId, ContextTableId, ContextRecId from workflowTrackingStatusTable where workflowTrackingStatusTable.ContextCompanyId == curext() && workflowTrackingStatusTable.ContextTableId == PurchTable.TableId && workflowTrackingStatusTable.ContextRecId == PurchTable.RecId join firstonly TrackingId, CreatedDateTime from workflowTrackingTable order by CreatedDateTime desc where workflowTrackin

Define dimension values to container in ax 2012

To Define dimension values to container in ax 2012 you can try below code same way you can do for other dimension values like department,region ,store etc. DimensionDefault defaultDimension; str costcenter; Container con,defDimension,ledgerDimension; costcenter="0122"; if(costcenter) { defDimension = ["COSTCENTRE",costcenter]; } defDimension = [1] + defDimension; You can use defDimension value to AxdDimensionUtil::getDimensionAttributeValueSetId method to get default dimension recid as per provided values.

Surrogate key in Axapta

A surrogate key is an artificial value that has no meaning to the user, but is guaranteed to be unique by the database itself.  Surrogate key is like an Index defined by the application.And RecId is automatically populated by ax for reference purpose in table level.If you didn't specify any primary index then system will specify one default index called surrogate key. If You did not defined any index for the table directly take recid as surrogate key.