Replace \ Delegate Workflow User

With this piece of Code we can delegate Workflow from One User to another Using X++ Here I am taking example of Purchase Requistion static void waj_replaceWorkflowUser(Args _args) { workflowtrackingstatustable workflowtrackingstatustable; workflowtrackingtable workflowtrackingtable; PurchReqTable purchreqTable; WorkflowWorkItemTable workItem; WorkflowStepTable workFlowStepTableSequence, workFlowStepTable; WORKFLOWTRACKINGCOMMENTTABLE WORKFLOWTRACKINGCOMMENTTABLE; purchreqTable = purchreqTable::findPurchReqId(‘PR-010454’); select workItem order by RecId desc where workItem.RefTableId == tableNum(purchReqTable) […]

Enable Modified by and Created by on ALL Parameters tables

Handy Code to have , Can be use to change any of the property of a table also just with the slightest change.   static void Waj_EnableProperties(Args _args) { SysDictTable dictTable,sysDictTable; TreeNode node; #AOT Name name; TreeNode treeNode; str indexName; #Properties ; treeNode = TreeNode::findNode(#TablesPath); treeNode = treeNode.AOTfirstChild(); while (treeNode) { name = treeNode.AOTname(); sysDictTable = […]

Create Ledger dimension from string values

1 – By using the below code one can create ledger dimesion recId using X++ Combination of Main Account and DimensionValue container offsetAccount; RefRecId ledgerDimension; offsetAccount = [‘11850000’, ‘11850000’, 3, ‘Department’, ‘101’, ‘Customer’,‘Cus-101’, ‘Vendor’, ‘Vend-101’]; //[MainAccount,MainAccount, NoOfDimensions, DimensionName, value] ledgerDimension = AxdDimensionUtil::getLedgerAccountId(offsetAccount); 2 – Create Ledger dimension from main account (default account) and default dimension […]