x++


Dynamics AX 2012 parsing Int32 to table field integer


I'm using a referenced DLL to retrieve data from a webservice. The data retrieves well. I copy over some of the fields to inMemory tables. This works well unless for the Int32 types.
As you can see, the Id field is of type Int32. The table field (ProductId) is an Integer.
This compiles without errors, but when i run the code i get the following error:
Error executing code: Wrong argument types in variable assignment.
This error points to the line with the productId. Removing it makes the code work. I've also tried making the Id a string, and then str2int() the field but that doesn't work either.
Any idea's?
Thanks,
steve
Try to marshal explicitly between the two types:
System.Int32 netInt;
int xppInt;
;
// -- Other code
// ...
netInt = product.get_Id();
xppInt = netInt;
tempData.ProductId = xppInt;

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
cheerio
ecmascript-6
nunit
pda
jelastic
jwplayer
knitr
nested-if
onclick
pkcs#11
arangodb
openstreetmap
pega
mod-security
azure-powershell
android-7.0-nougat
shortest-path
replication
scriptella
epsilon
ckfinder
slidetoggle
corpus
subclass
vex
ntp
python-2.6
mockjax
angularjs-material
hreflang
sharepoint-workflow
docfx
typesafe-config
mcustomscrollbar
tasm
android-softkeyboard
preloader
uiimage
getchar
gitlist
oozie-coordinator
cpu-cache
cudd
resourcemanager
mta
beamer
jboss-tools
ng-grid
scaffolding
lean
observablecollection
stream-processing
boost-serialization
qbxml
blitline
toast
jbase
character-replacement
oracle-spatial
ons-api
telepat
at-job
execve
teaspoon
wcm
tweenlite
grails-plugin-rabbitmq
jjaql
paste
vsx
square-bracket
mysql-error-1044
jammer
code-duplication
windows-phone-8-sdk
beaker-testing
octal
actiondispatch
server-administration
device-width
qtconcurrent
web-farm
isa-swizzling
role
exponentiation
tmx
codebase
photolibrary
duplex
alsb

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