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

Transferring open account records between customers
How to make sure that a form is only opened once?
Extend system menu in Dynamics AX 2012?
How to show selected items of certain table on the different table in Dynamics AX 2012?
AllowEdit doesn't work properly in Dynamics AX
AX 2012 how to set args record datasource in X++
Clients seem to be running old (buggy) code after XPO project import
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

Categories

HOME
httparty
amp-html
seo
tivoli
soa
rom
cakephp-3.4
opengl-3
special-characters
elasticsearch-5
supervisor
selenium-ide
gource
job-scheduling
feathersjs
easyphp
symbols
event-store
google-api-client
google-cloud-print
fat
intersystems-cache
rpgle
paperjs
cppreference
uitapgesturerecognizer
userdefaults
powershell-ise
cognos-bi
fstream
card.io
contacts
browser-extension
yowsup
raft
graphhopper
z-notation
protein-database
password-protection
linq-to-objects
mcustomscrollbar
resolution
visa
install.packages
tcc
show-hide
sonarlint-eclipse
tinymce-3
identification
page-replacement
tinkerpop
semantic-logging
compiler-design
backbone-collections
ngmaterial
android-instrumentation
pocketsphinx-android
lrs
flex4.6
uicolor
expectations
dimension
firebase-security
lean
ikiwiki
toast
crouton-os
file-move
pypiserver
mod-proxy
theos
wxformbuilder
multitasking
scriptaculous
code-duplication
dtmf
beaker-testing
kogrid
kaleidoscope
scmmanager
epiceditor
jquery-1.9
server-administration
booksleeve
redis-py
mkv
rmiregistry
garbage
thttpd
fusefabric
josql
oracle-enterprise-linux
filemerge
android-holo-everywhere
update-statement
listactivity
creole
http-daemon
codebase
luajava
uideviceorientation
alsb
linfu-dynamicproxy

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