x++


AX 2012 how to set args record datasource in X++


Can anyone tell me what should I do in X++ to get a NOT null value from args.record().datasource() method after executing the following statements:
PurchTable purchTable;
args.record(purchTable);
if(args.record().datasource()) //this condition fails because of null value
{
//I have to reach here
}
I know that the same code works fine when it is called from Form but my scenario is that I have to execute this code from within X++. Please help!
args.record().datasource() will retrieve a form datasource. Here, you are using a table buffer only. That's why you don't have anything.
If you want to retrieve the table buffer, you might go this way:
PurchTable purchTable;
PurchTable argPurchTable;
select firstOnly purchTable;
args.record(purchTable);
if (args.record() && args.dataset() == tableNum(PurchTable))
{
argPurchTable = args.record();
//do something
}
Regards,
Geoffrey

Related Links

how to protect the x++ source code
About Data Dictionary
setTimeOut and local function
Passing FromControl in a lookup override method
Reference control from datamethod in generated design
Extended EDT does not compare dates
How to display a tooltip in Dynamics AX 4.0?
how to disable intellisense in ax2012's code editor?
How do you “Run” a class
General quesions about Dynamics Ax
Convert date into julian date
How to change the level of AX info messages
X++ unbound control
WeekOfYear in X++ using .net lib
How to tell what module has called the program
Getting the index of an array element of EDT Dimension

Categories

HOME
gridview
deep-learning
c99
amp-html
android-studio-2.2
nunit
solver
yandex
3d-reconstruction
square
hpc
polling
jquery-ui
spring-session
trac
vimdiff
ipmitool
php-5.6
radgridview
gource
parameter-passing
modbus-tcp
alpacajs
dynamic-sql
fileserver
asp.net-mvc-viewmodel
smartclient
bourbon
sencha-touch
springfox
jquery-ias
cgbitmapcontext
backpack-for-laravel
scriptella
google-api-client
draft-js-plugins
opentk
bulletphysics
jackson-modules
winpe
arduino-ide
sql-delete
numpy-broadcasting
google-earth-engine
connection-pool
node-mssql
metawidget
chef-solo
sharp-snmp
print-css
bindingnavigator
avcapturedevice
uiimage
opencmis
yii2-api
bluez
podscms
amq
offline.js
gameplay-kit
vibrate
reachability
angular2-testing
winusb
pacemaker
qtplugin
envi
greatest-n-per-group
signalr.client
macaulay2
rspec2
shopping
embedding
createprocess
realsense
jparsec
relativelayout
grgit
pypiserver
evolus-pencil
mod-proxy
rrule
apache-spark-1.3
showdialog
uncaught-typeerror
viewer
structuremap3
entry-point
psr-4
paw
kissfft
draw2d-js
fpdi
android-audiorecord
windows-embedded-standard
joomla-template
pclzip
font-awesome-4.0.0
server-administration
twisted.web
veracity
pinch
automationelement
creole
w3c-geolocation
event-receiver
unattended-processing
int64

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App