x++


Having button that runs code, but doesn't submit data to (or validates against) table


I'm trying to add a button to an existing form (BankAccountTable). I want to add a button to run an outside process with the value of one of the form fields as a parameter.
The value is being read using this code:
str value = element.design().controlName("FieldName").valueStr();
However when I click the button Dynamics displays what fields must be filled in. This doesn't happen if the click method doesn't reference the form fields (i.e. info("click");).
How can I:
Read the value of a field without triggering form validation?
and/or
Have a button (or command buttton) that doesn't trigger form validation?
The second question, how to avoid validation, is easy: set the button attribute SaveRecord to No.
You should rarely need to access the control value directly. A better option is usually to access the bound field directly: table.FieldName.
If the control is not bound to a field, then change the AutoDeclation attribute to Yes and access the control directly: fieldName.text(). The methods text, realValue or selection is a better choice than valueStr.

Related Links

AX2012 Sales Order Creation through AX Classes
How can I loop over Tables which contain specific characters in their AOT name and delete the data?
Having button that runs code, but doesn't submit data to (or validates against) table
Where are Duties (table name) stored in AX?
Advanced query range
How to read from an Excel file?
group by clause in X++
Determine the number of affected rows by an update_recordset call in Dynamics 4.0?
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?

Categories

HOME
beautifulsoup
obfuscation
database-normalization
limit
settings
vsm
angularfire2
vert.x
discrete-mathematics
octave
text-mining
mxgraph
ycsb
cmdb
datastage
spring-social
pybossa
http-post
modbus-tcp
scsi
red5
identity-management
nim
inno-download-plugin
joptionpane
moses
has-and-belongs-to-many
handler
tpm
browser-sync
magento-1.8
sql-server-2000
roblox
google-knowledge-graph
sessionstorage
recurrent-neural-network
gdata
p4merge
branching-and-merging
android-ibeacon
chronicle-map
apache-spark-dataset
double-click
amq
video-conferencing
stdmap
azure-cli
oracleclient
truezip
git-flow
juice-ui
testrail
smartfoxserver
cubism.js
builtins
pacemaker
installshield-2010
udpclient
dbamp
phpwebsocket
invoke-sqlcmd
libvlc
directdraw
flock
coda
wso2greg
canvg
google-refine
fail2ban
j-security-check
zxspectrum
mass-assignment
document-repository
cosine-similarity
packet-sniffers
linkedin-jsapi
rmysql
encryption-asymmetric
template-deduction
winginx
draw2d-js
menubar
mt4j
jquery-1.9
wimax
device-width
multiplexing
xcelsius
facebook-iframe
rowlex
blender-2.49
burndowncharts
spread
data-mapping
visualj#
xpsdocument
localizable.strings
unmanagedresources
online-storage

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