c#


Using NetSuite custom records from C#


I have created custom data type in NetSuite called Webinar:
Now I would like to add new record from C# via NetSuite web service.:
CustomRecord rec = new CustomRecord();
RecordRef recType = new RecordRef();
recType.internalId = "479"; // Internal ID of custom record type, not individual record id
recType.type = RecordType.customRecord;
recType.typeSpecified = true;
rec.recType = recType;
rec.name = "Webinar";
CustomFieldRef[] customFieldArray = new CustomFieldRef[1];
StringCustomFieldRef stringField = new StringCustomFieldRef();
stringField.scriptId = "customrecord479";
stringField.value = "A string";
customFieldArray[0] = stringField;
rec.customFieldList = customFieldArray;
var addresponse = Service.add(rec);
During adding record I have error:
The specified custom field reference customrecord479 is invalid.
What is wrong and how to add record by using custom data types?
In your example, customrecord479 is the script id for a record type but you're trying to use it for the script id of a custom field. Script id's for fields on custom records start with custrecord, not customrecord.
Also, in your screenshot, you show two custom fields that are of type 'Time of Day' and 'Date'. In your code, you're trying to set the value for a StringCustomFieldRef. Try creating a DateCustomFieldRef instead and in the scriptId property use either 'custrecordcustrecord_webinar_time' or 'custrecordcustrecord_webinar_date' as you have shown in your screenshot.
You might also want to change the script id's for those fields so your not duplicating the 'custrecord' portion.

Related Links

How to set website theme to all webpages using a drop down list?
How to set selectedcolor of ColorCanvas by using Argb in code behind
How to set a transition property using Transitionals library
How to limit textbox maxlength by byte in winrt?
Entity Framework 6 database migrations for isolated multi-tenant setup
File upload / did I make a mistake choosing vb.net instead of php?
Find data in database
Calling sharepoint from web service
Baidu web search engine API
Searching for records on one exact day
Must declare the scalar variable “#ID” for insert parameter
How to get an Image from facebook and use ImageResizer MVC4 & C#
Launch another application [duplicate]
WriteAllLines arguments give an overload error
Calling a C# DLL from C; linking problems
Does C# application made in windows 7 will run in windows xp [closed]

Categories

HOME
oauth-2.0
skype-for-business
javafx
teradata
ide
virtual-machine
casting
latex
livecharts
where
arguments
bitbucket
msbi
pdf-generation
android-webview
genexus
rtc
aspectj
email-attachments
react-select
appsettings
background-image
brightway
css-float
descriptor
bug-reporting
rndis
smali
google-drive-android-api
devexpress-mvc
uipath
aws-certificate-manager
expressionengine
traveling-salesman
utc
large-files
checkmarx
request-uri
2checkout
vtd-xml
keil
flickr
microstrategy
matlab-compiler
leaderboard
kdevelop
mybatis-generator
office-interop
azure-web-roles
android-graphview
binary-decision-diagram
wufoo
head
f#-fake
taleo
angular-fullstack
jks
google-chrome-storage
monaca
jcs
riemann
richtext
kendo-scheduler
opticalflow
nsalert
disassembly
robotc
fileopendialog
qudpsocket
racket-student-languages
consolidation
visual-web-developer
foreground
key-value-store
gdi
php-java-bridge
boost-bind
transaction-isolation
treelist
chomsky-normal-form
salesforce-service-cloud
abstract
ooad
computability
gitk
windows-phone-8-emulator
tinymce-plugins
gcc-warning
genome
screen-lock
strcpy
nsurlrequest
isl
lettuce
opencobol
mixradio
mongoid4
node-amqp
randomaccessfile
misfire-instruction
caroufredsel
backbone-views
removeall
junction-table
architectural-patterns
database-restore
linqdatasource
feincms
correctness
webpage-screenshot
winrt-async
umfpack
browser-state
uccapi
djangoappengine
disk-based
cstring

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