Как мне выпустить в рамках релиза? например при выпуске сборки комплекта я хочу создать / выпустить одноэтапный перенос

У вас уже есть продление, я думаю, проблема в транзакции.

Итак, при определенных обстоятельствах хотите передать готовый предмет Создание работает, а Релиз - нет (в частности, «iNTransferEntry.release.Press ();». Другой код также имеет проблемы, включая большую часть логики выпуска в транзакции. Транзакция находится вне моего контроля, поскольку я расширяю релиз уже в рамках транзакции релиза. Я могу принять что-то, что просто выводит «Новый» выпуск из существующей транзакции, поэтому могу потерпеть неудачу в этом выпуске, если оставлю неизданный документ там.

Грубый код в PXGraphExtension, защищенный виртуальный void INRegister_RowPersisted (отправитель PXCache, PXRowPersistedEventArgs e, PXRowPersisted del)

#region Transfer Back
INTransferEntry iNTransferEntry = PXGraph.CreateInstance<INTransferEntry>();
INRegister iNRegister = new INRegister();
iNRegister.DocType = INDocType.Transfer;
iNRegister = iNTransferEntry.CurrentDocument.Insert(iNRegister);
iNRegister.TransferType = INTransferType.OneStep;
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "fa2a598d-6df0-4f66-9e95-01c751ae2765"));
// From always the current kit assembly site (e.g. Move from wherever it was made)
iNRegister.SiteID = kae.Document.Current.SiteID.GetValueOrDefault();
iNRegister = iNTransferEntry.CurrentDocument.Update(iNRegister);
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} {1}", "481f805f-4c1e-47b9-9624-814b722c2c4a", iNRegister.SiteID));
// To always the Work order site, so can use from there
iNRegister.ToSiteID = WorkOrderGraph.WOrderHeader.Current.SiteID.GetValueOrDefault();
iNRegister = iNTransferEntry.CurrentDocument.Update(iNRegister);
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0} {1}", "4c2b9232-9149-4f8f-8b16-4be9e474ab2e", iNRegister.ToSiteID));
// Create the Item
INTran iNTran = (INTran)iNTransferEntry.transactions.Cache.CreateInstance();
// Always the finished good
iNTran.InventoryID = kae.Document.Current.InventoryID;
iNTran.SiteID = iNRegister.SiteID;
// Always the full quantity, and the existing UOM.  So All should move back.
iNTran.Qty = kae.Document.Current.Qty;
iNTran.UOM = kae.Document.Current.UOM;
iNTran.TranDesc = string.Format("{0} Completing {1}", WorkOrderGraph.WOrderHeader.Current.WONbr.TrimEnd(), kae.Document.Current.RefNbr.TrimEnd());
iNTran = iNTransferEntry.transactions.Update(iNTran);
#region Release hold, if needed
if (iNTransferEntry.CurrentDocument.Current.Hold.GetValueOrDefault())
{
    Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "651c1afd-f6de-43ad-8dae-9898b0ac9774"));
    iNTransferEntry.CurrentDocument.Current.Hold = false;
    Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "f50e42c8-08d8-4bf3-b122-f41f1c8e54c4"));
    iNTransferEntry.CurrentDocument.Current = iNTransferEntry.CurrentDocument.Update(iNTransferEntry.CurrentDocument.Current);
    Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "352f80e4-b59e-42db-80a4-7a62525bdc09"));
}
#endregion
#region Fix the control totals, even though they may not be needed
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "7c2cb9dd-5905-4e49-8c3d-02b2adf73202"));
iNTransferEntry.CurrentDocument.Current.ControlAmount = iNTransferEntry.CurrentDocument.Current.TotalAmount;
iNTransferEntry.CurrentDocument.Current.ControlCost = iNTransferEntry.CurrentDocument.Current.TotalCost;
iNTransferEntry.CurrentDocument.Current.ControlQty = iNTransferEntry.CurrentDocument.Current.TotalQty;
iNTransferEntry.CurrentDocument.Current = iNTransferEntry.CurrentDocument.Update(iNTransferEntry.CurrentDocument.Current);
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "ee61774a-0e8c-4ddf-86e0-0b9a0da13e64"));
#endregion
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "74e70f04-a807-4451-8168-ce57b8080475"));
iNTransferEntry.Actions.PressSave();
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "c0bca41c-3f6f-46a0-9c52-872162c090fe"));
iNTransferEntry.release.Press();
Trace.TraceInformation(string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", "133bce7a-c597-426a-91c0-2e397895300e"));
PXTrace.WriteInformation(Messages.Matrix_WorkOrder_Action_Released1Step, iNTransferEntry.transfer.Current.RefNbr);

Возникла ошибка в трассировке: PX.Data.PXOperationCompletedSingleErrorException: Истекло время ожидания выполнения. Время ожидания истекло до завершения операции или сервер не отвечает.

подробнее об ошибке:

2018-08-10 13:29:59Z [35] Error w3wp.exe 0: 23803b8a-d4f4-4523-b310-a6ddd16bc3bd 000021 PX.Data.PXOperationCompletedSingleErrorException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> PX.Data.PXOperationCompletedSingleErrorException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> PX.Data.PXDatabaseException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> System.Data.SqlClient.SqlException: Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> System.ComponentModel.Win32Exception: The wait operation timed out
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at PX.Data.PXDatabaseProviderBase.ExecuteNonQuery(IDbCommand command)
   at PX.Data.PXDatabaseProviderBase.updateCommon(IDbCommand cmd, String tableName, Int32 cid, PXDataFieldParam[] pars, AuditTable audit, Boolean isVisibilityUpdate, Boolean sharedDelete, companySetting setting)
   at PX.Data.PXDatabaseProviderBase.<>c__DisplayClass127_0.<update>b__1(String tn, IDbCommand cmd)
   at PX.Data.PXDatabaseProviderBase.usingDbCommand[T](Func`3 fnUsefulActions, String commandText, String tableName)
   --- End of inner exception stack trace ---
   at PX.Data.PXDatabaseProviderBase.usingDbCommand[T](Func`3 fnUsefulActions, String commandText, String tableName)
   at PX.Data.PXDatabaseProviderBase.Update(Type table, PXDataFieldParam[] pars)
   at PX.Data.PXDatabase.Update[Table](PXDataFieldParam[] pars)
   at PX.Objects.CS.AutoNumberAttribute.GetNextNumberInt(PXCache sender, Object data, String numberingID, Nullable`1 dateTime, String lastAssigned, String& LastNbr, String& WarnNbr, Nullable`1& NumberingSEQ) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\CS\Descriptor\Attribute.cs:line 2867
   at PX.Objects.CS.AutoNumberAttribute.GetNextNumber(PXCache sender, Object data, String numberingID, Nullable`1 dateTime, String lastAssigned, String& LastNbr, String& WarnNbr, Nullable`1& NumberingSEQ) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\CS\Descriptor\Attribute.cs:line 2954
   at PX.Objects.CS.AutoNumberAttribute.RowPersisting(PXCache sender, PXRowPersistingEventArgs e) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\CS\Descriptor\Attribute.cs:line 2802
   at PX.Data.PXCache.OnRowPersisting(Object item, PXDBOperation operation)
   at PX.Data.PXCache`1.PersistInserted(Object row)
   at PX.Data.PXCache`1.Persist(PXDBOperation operation)
   at PX.Data.PXGraph.Persist(Type cacheType, PXDBOperation operation)
   at PX.Data.PXGraph.Persist()
   at PX.Objects.GL.JournalEntry.Persist() in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\GL\JournalEntry.cs:line 1201
   at PX.Data.PXSave`1.<Handler>d__2.MoveNext()
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.PressImpl(Boolean internalCall, Boolean externalCall)
   at PX.Data.PXAction`1.Press()
   at PX.Objects.IN.INReleaseProcess.ReleaseDocProc(JournalEntry je, INRegister doc) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 5083
   at PX.Objects.IN.INReleaseProcess.ReleaseDocProcR(JournalEntry je, INRegister doc) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 4472
   at PX.Objects.IN.INDocumentRelease.ReleaseDoc(List`1 list, Boolean isMassProcess) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 119
   --- End of inner exception stack trace ---
   at PX.Objects.IN.INDocumentRelease.ReleaseDoc(List`1 list, Boolean isMassProcess) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 145
   at PX.Data.PXLongOperation.StartOperation(Object key, Byte[] timeStamp, PXToggleAsyncDelegate method, Boolean forceAsync)
   at PX.Data.PXLongOperation.StartOperation(PXGraph graph, PXToggleAsyncDelegate method)
   at PX.Objects.IN.INTransferEntry.Release(PXAdapter adapter) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INTransferEntry.cs:line 130
   at PX.Data.PXAction`1.a(PXAdapter A_0)
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.PressImpl(Boolean internalCall, Boolean externalCall)
   at PX.Data.PXAction`1.Press()
   at MaxQ.Products.SupplyChain.MQSCINDocumentReleaseExt.INRegister_RowPersisted(PXCache sender, PXRowPersistedEventArgs e, PXRowPersisted del) in C:\_Development\Acumatica Development\MaxQ Products\Supply Chain Planning\Source\Graph\MQSCINDocumentReleaseExt.cs:line 336
   at PX.Data.PXCache.OnRowPersisted(Object item, PXDBOperation operation, PXTranStatus tranStatus, Exception exception)
   at PX.Data.PXCache`1.Persisted(Boolean isAborted, Exception exception)
   at PX.Data.PXGraph.Persist()
   at PX.Objects.IN.INReleaseProcess.ReleaseDocProc(JournalEntry je, INRegister doc) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 5091
   at PX.Objects.IN.INReleaseProcess.ReleaseDocProcR(JournalEntry je, INRegister doc) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 4472
   at PX.Objects.IN.INDocumentRelease.ReleaseDoc(List`1 list, Boolean isMassProcess) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 119
   --- End of inner exception stack trace ---
   at PX.Objects.IN.INDocumentRelease.ReleaseDoc(List`1 list, Boolean isMassProcess) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\INDocumentRelease.cs:line 145
   at PX.Data.PXLongOperation.StartOperation(Object key, Byte[] timeStamp, PXToggleAsyncDelegate method, Boolean forceAsync)
   at PX.Data.PXLongOperation.StartOperation(PXGraph graph, PXToggleAsyncDelegate method)
   at PX.Objects.IN.KitAssemblyEntry.Release(PXAdapter adapter) in F:\Bld2\AC-FULL2017R2-JOB1\sources\WebSites\Pure\PX.Objects\IN\KitAssemblyEntry.cs:line 138
   at PX.Data.PXAction`1.a(PXAdapter A_0)
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.<Press>d__31.MoveNext()
   at PX.Data.PXAction`1.PressImpl(Boolean internalCall, Boolean externalCall)
   at PX.Data.PXAction`1.Press()
   at MaxQ.Products.SupplyChain.WorkOrderReportProductionProcess.KitAssemblyReleaseOrDelete(MQSCWorkOrd& workOrd) in C:\_Development\Acumatica Development\MaxQ Products\Supply Chain Planning\Source\Graph\WorkOrderReportProductionProcess.cs:line 1204
   at MaxQ.Products.SupplyChain.WorkOrderReportProductionProcess.ProcessWOrders(List`1 WOrdersToProcess, Nullable`1 Consolidate) in C:\_Development\Acumatica Development\MaxQ Products\Supply Chain Planning\Source\Graph\WorkOrderReportProductionProcess.cs:line 133

как долго длилась эта операция?

Yuriy Zaletskyy 12.08.2018 22:20

Это немного расплывчато, но не работает из-за блокировки базы данных. Время ожидания истекает примерно через 20 секунд.

user3708398 14.08.2018 15:08

Пробовал новое соединение PXConnection, но это тоже не удалось из-за блокировки транзакции. Я создаю перевод в рамках первой транзакции, поэтому никто другой не сможет его «увидеть», пока он не будет зафиксирован. Так что, если процесс выпуска делает НИЧЕГО за пределами «Текущей» области транзакции, он потерпит неудачу. например найдите "using (new PXConnectionScope ())" в INDocumentRelease, они БУДУТ предотвращать его вызов из другой транзакции. Этот конкретный экземпляр - «Acumatica 2017 R2 Build 17.200.0401»

user3708398 14.08.2018 15:10
0
3
114
0

Другие вопросы по теме