Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Transfer Order : Create status from created to shipped after importing excel lines

(0) ShareShare
ReportReport
Posted on by 20

Hi every one i have been trying to work on the transfer order to change its status from created to shipped but the status changes to received dont now the reason, 

Code:

//public void usingExcel_Receive(Args _args)
//{
// InventTransferTable transferTable;
// InventTransferLine transferLine;
// InventDim inventDim;
// InventDimCombination dimCombination;
// KHDI_InventTransferLineTmp TransferLineStag;

// Dialog dialog;
// //RecordInsertList recordInsertList;
// DialogGroup dialogGroup;
// FormBuildControl formBuildControl;
// FileUploadBuild fileUploadBuild;
// FileUpload fileUpload;
// FileUploadTemporaryStorageResult temporaryStorage;

// int rowCount, i;

// System.IO.Stream stream;
// ExcelSpreadsheetName sheeet;
// FileUploadBuild fileUploadB;

// dialog = new Dialog("Import transfer-order lines");
// //recordInsertList = new RecordInsertList(Tablenum(InventTransferTable));
// dialogGroup = dialog.addGroup("@SYP4881191");
// formBuildControl = dialog.formBuildDesign().control(dialogGroup.name());
// fileUploadBuild = formBuildControl.addControlEx(classstr(FileUpload), "@SYS117211");

// fileUploadBuild.style(FileUploadStyle::MinimalWithFilename);
// fileUploadBuild.fileTypesAccepted('.xlsx');

// if(dialog.run() && dialog.closedOk())
// {
// fileUpload = dialog.formRun().control(dialog.formRun().controlId("@SYS117211"));
// temporaryStorage = fileUpload.getFileUploadResult();

// if (temporaryStorage != null && temporaryStorage.getuploadstatus())
// {
// stream = temporaryStorage.openResult();
// using (ExcelPackage excelPackage = new ExcelPackage(stream))
// {
// excelPackage.Load(stream);
// ExcelWorksheet worksheet = excelPackage.get_Workbook().get_Worksheets().get_Item(1);
// OfficeOpenXml.ExcelRange range = worksheet.Cells;
// rowCount = worksheet.Dimension.End.Row - worksheet.Dimension.Start.Row + 1;

// delete_from TransferLineStag;

// for (i = 2; i <= rowCount; i++)
// {
// TransferLineStag.clear();

// TransferLineStag.TransferId = range.get_Item(i, 1).value;
// TransferLineStag.ItemId = range.get_Item(i, 2).value;
// TransferLineStag.InventSizeId = range.get_Item(i, 3).value;
// TransferLineStag.InventColorId = range.get_Item(i, 4).value;
// TransferLineStag.QtyShipped = range.get_Item(i, 5).value;

// TransferLineStag.insert();
// }
// }

// try
// {
// update_recordset transferLine
// setting QtyShipped = TransferLineStag.QtyShipped
// join inventDim
// where inventDim.inventDimId == transferLine.InventDimId
// join TransferLineStag
// where inventDim.InventSizeId == TransferLineStag.InventSizeId
// && inventDim.InventColorId == TransferLineStag.InventColorId
// && transferLine.TransferId == TransferLineStag.TransferId
// && transferLine.ItemId == TransferLineStag.ItemId
// join transferTable
// where transferTable.TransferId == TransferLineStag.TransferId
// && transferTable.TransferStatus == InventTransferStatus::Shipped;

// Info(strFmt("Transfer-order lines were imported successfully"));
// }
// catch (Exception::Error)
// {
// error(strFmt("While updating lines, import from staging was unsuccessful. \n "));
// }

// //recordInsertList.insertDatabase();
// //this.createTransferOrderLines(_args);
// }
// }
//}

  • André Arnaud de Calavon Profile Picture
    294,269 Super User 2025 Season 1 on at
    RE: Transfer Order : Create status from created to shipped after importing excel lines

    Hi Aamir,

    You can't change the status manually. You need to post the ship action. You can mimic that behavior with x++ coding.

    The posting will update related InventTrans records and the on hand information. This was not taken care of in your coding.

  • Community Member Profile Picture
    on at
    RE: Transfer Order : Create status from created to shipped after importing excel lines

    the shared is not posting the TO explicitly, however I can see there is createTransferOrderlines method is being called, did you check whether any posting logic is written there?

    also, check if there are any extension created which is triggering the TO posting process.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,269 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans