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

Determine if a job is running in X++ code
Dynamics AX 2012 parsing Int32 to table field integer
Cancel Sales order packing slip through x++
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++

Categories

HOME
sonarqube
api
eslint
merge
jax-rs
ns-3
oracle-apex-5
sitecore
shiro
spring-data-mongodb
simulink
permissions
emscripten
jetty
jtextpane
character
special-characters
recordrtc
android-securityexception
mxgraph
jxl
rtf
tput
intercom
symmetricds
docx
azure-powershell
html5-appcache
git-extensions
digital-signature
database-connection
lilypond
ksh
spring-async
backpack-for-laravel
gulp-watch
r-mice
visual-studio-extensions
mongoid6
event-store
draft-js-plugins
progress-bar
8051
user-defined-functions
mql
testcomplete
mockjax
android-gridview
fossil
modalviewcontroller
xdocreport
release
sim-card
health-monitoring
visa
apache-directory
stylecop
libgphoto2
netbeans6.8
facebook-pixel
manova
posixct
magic-draw
amq
wpas
context-sensitive-grammar
subnet
headless
cup
monkey
vibrate
swingworker
reachability
cvxpy
slackware
node-request
cubism.js
segment-io
model-associations
ng-grid
hclust
installshield-2010
firebase-security
lean
aurora
kiosk
thread-sleep
aspen
qbxml
jnlua
boomerang
r-package
file-move
roadkill-wiki
teamcity-9.1
adehabitathr
rapidsvn
filesplitting
administration
personalization
dct
rolify
beaker-testing
process-explorer
midlet
iboutlet
faye
boost-signals
subproject
procedures
webdev.webserver
object-database
drupal-fivestar
tabpanel
filesystemobject
dsl-tools
change-management

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