Posts

Showing posts from June, 2024

RFQ -> PR relation in D365fo X++

 RFQ -> PR relation in D365fo X++ Code:  public str getPurchReqNo() { PurchReqTable PurchReqTable; PurchReqLine PurchReqLine; PurchRFQCaseTable PurchRFQCaseTable; PurchRFQCaseLine PurchRFQCaseLine; select PurchReqTable join PurchReqLine where PurchReqLine.PurchReqTable == PurchReqTable.RecId join PurchRFQCaseLine where PurchReqLine.LineRefId == PurchRFQCaseLine.ReqLineRefId join PurchRFQCaseTable where PurchRFQCaseLine.RFQCaseId ==                     PurchRFQCaseTable.RFQCaseId && PurchRFQCaseTable.RFQCaseId == this.RFQCaseId; return PurchReqTable.PurchReqId; }

Get Current Legal Entity workflow configuration in D365fo x++

  Get Current Legal Entity workflow configuration in D365fo x++ select TemplateName from WorkflowTable             join ENABLED from WorkflowVersionTable             where WorkflowVersionTable.WorkflowTable == WorkflowTable.RecId             && workflowVersionTable.ENABLED == NoYes::Yes             && WorkflowTable.TemplateName ==  'DSSH_SalesOrderWFType'             && WorkflowTable.DATAAREA == curExt();

Suspend main Account in D365fo x++

 Suspend main Account in D365fo x++ 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 static void SUSPEND_ACCOUNT(boolean set = true , Suspended _isSuspended = true ) { DimensionAttrValueLedgerOverride dimensionAttrValueLedgerOverride; Ledger currentledger; Suspended isMainAccountSuspended; #ISOCountryRegionCodes      DimensionAttributeValue dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndEntityInst( DimensionAttribute::getWellKnownDimensionAttribute(DimensionAttributeType::MainAccount), _recId, true, true);      ttsbegin; //Suspend this main account for all ledgers update_recordset dimensionAttrValueLedgerOverride setting IsSuspended = NoYes::Yes where dimensionAttrValueLedgerOverride.DimensionAttributeValue == dimAttrValue.RecId; dimAttrValue.IsSuspended = _isSus...