Run RDP based report from Code & passing parameter using Data contract

Bsic Code to run RDP based report using x++ and passing parameters to data contract. SrsReportRunController controller = new SrsReportRunController(); VendSOAReportTmpContract rdpContract = new VendSOAReportTmpContract (); SRSPrintDestinationSettings settings;   controller.parmReportName(ssrsReportStr(VendSOATmpReport,PrecisionDesign)); controller.parmShowDialog(false); rdpContract.parmVendAccount(VendPurchOrderJour.OrderAccount); controller.parmReportContract().parmRdpContract(rdpContract); controller.startOperation(); Advertisements

Step name of Workflow

Below is the reference sample code to get the workflow step name. public display str 25 stepName(PurchReqTable _purchReqTable) { container con; PurchReqTable purchReqTable; PurchReqTableHistory purchReqTableHistory; WorkflowTrackingStatusTable workflowTrackingStatus; WorkflowTrackingTable workflowTracking; utcdatetime validDate = DateTimeUtil::utcNow(); WorkflowStepName stepName; TransDate stepSinceDate; PurchReqRequisitionStatus status; TransDate statusSinceDate; RefRecId workflowTrackingStatusRecId; RefRecId workflowStepRecId; UserInfo userInfo; WorkflowTrackingTable workflowTrackingLocal,workflowTrackingLocal2,workflowTrackingLocal3; WorkflowStepTable workflowstepTable; RefRecId _purchReqTableRecId = _purchReqTable.RecId; […]

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 […]

Create Default dimension using x++

The following job will get a DimensionAttributeValueSet record ID base on the a set of dimension values.   static void CreateDefaultDimensions(Args _args) { PurchTable purchTable; DimensionAttributeValueSetStorage valueSetStorage = new DimensionAttributeValueSetStorage(); DimensionDefault result; int i; DimensionAttribute dimensionAttribute; DimensionAttributeValue dimensionAttributeValue; // Note that “Item” is not one of the default dimension, // but DimensionAttributeValueSetStorage will handle it […]

Get Comments of a Workflow

We can use this sample code to get the workflow comments on particular Record. Project budget is my desired table  . you can replace ProjBudget to any other table on which you want to get the entered comments. while select WORKFLOWTRACKINGSTATUSTABLE where WORKFLOWTRACKINGSTATUSTABLE.ContextRecId == projBudget.RecId  // && WORKFLOWTRACKINGSTATUSTABLE.ContextTableId == tableNum(ProjBudget) { while select WORKFLOWTRACKINGTABLE where WORKFLOWTRACKINGTABLE.WorkflowTrackingStatusTable […]