x++


Cancel Sales order packing slip through x++


I've been trying to cancel a Sales order packing slip. I'm verifying if it worked by trying to repost but receiving one error after the next.
I have found a way to post a packing slip but is there an easy way to cancel a packing slip without finding all the fields that need to be updated in the inventory movement tables?
Is there something simple like posting (example below):
static void SalesOrderPost(Args _args)
{
SalesFormLetter salesFormLetter;
salesTable salesTable;
salesTable = SalesTable::find('SO-101248');
salesFormLetter = SalesFormLetter::construct(
DocumentStatus::PackingSlip);
salesFormLetter.update(
salesTable,
systemDateGet(),
SalesUpdate::All,
AccountOrder::None,
NoYes::No,
NoYes::Yes);
}
I was able to retrieve the customer packing slip journal record and pass it to the SalesFormLetter_PackingSlipCancel action menu item.
CustPackingSlipJour custPackingSlipJour;
boolean isCancelEnabled, isCorrectionEnabled;
Args args;
//find latest packing slip
select * from custPackingSlipJour
order by PackingSlipId desc
where custPackingSlipJour.SalesId == salesTable.SalesId;
[isCancelEnabled, isCorrectionEnabled] = custPackingSlipJour.canPackingSlipBeCanceledOrCorrected();
if(isCancelEnabled)
{
//"cancel" latest packing slip
args = new Args();
args.record(custPackingSlipJour);
new MenuFunction(menuitemActionStr(SalesFormLetter_PackingSlipCancel), MenuItemType::Action).run(args);
}
super();

Related Links

Number sequence AX 2012
SSRS MS words report with page break
How can you get a detailed error descriptions in Dynamics AX?
How to get the length of an array?
X++ loop through lines in grid control
Concatenating row values in x++
How do you access a macro in the AOT macro node?
How can I set the Backgoundcolor of an AX2012 Action Pane Button
How to Edit address using X++ in AX 2012
Number sequence issue Ax 2012?
Find code that's running in a Batch Job
What is the _isMexican boolean for in the Global::Checkpower method?
AlwaysOnTop property not behaving properly
Boolean AND logic in Microsoft Dynamics AX 2012 AIF QueryCriteria
Table: PrintMgmtSettings Field: Printjobsettings(Blob)
What happened to the hrplimittablerelationship table in ax-2012-r2?

Categories

HOME
kentico
checkstyle
ecmascript-6
mjml
pyqt
sitecore
nuget
3d-reconstruction
tail
data-visualization
banner
jtextpane
frontend
nstableheaderview
title
minecraft-forge
ibeacon-android
mel
jxl
naivebayes
automatic-ref-counting
nancy
favicon
entitymanager
vuejs
asp.net-mvc-viewmodel
dataflow-diagram
qliksense
outliers
bringtofront
gitlab-api
scatter3d
record
jett
dsx-desktop
vue-chartjs
indy10
servicestack-text
xajax
searchkit
ods
chef-solo
comparison-operators
resolution
visa
datacachefactory
clang++
ntvs
lightning
static-cast
template-toolkit
mathcad
bootstrap-tags-input
testrail
autosar
ziparchive
seek
google-cloud-console
mongodb-php
rspec2
pre-build-event
omniauth-facebook
sklearn-pandas
findfirst
jaunt-api
oracle-spatial
lazybones
jdi
pax-exam
visual-sourcesafe-2005
zscript
rdflib
spy++
universal-image-loader
tweenlite
cuba
xml-dsig
functional-java
draw2d-js
authlogic
ebay-lms
mongohq
dolby-audio-api
diem
video-codecs
asplinkbutton
patricia-trie
listitem
fusefabric
inkcanvas
relative
mysql-error-1205
nhprof
ruby-1.8
resharper-6.0
delimited-text
globals
addchild
wcf-instancing
dsl-tools
interop-domino
httpcookie
xslcompiledtransform

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App