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

use a ListBox to Filter Datagrid
regasm.exe is not a valid win32 application
How can i pass parameter from javascript to generic handler?
Task<WebResponse>.Wait lasts forever
How to keep a .NET Socket object connection open after postback?
How To send datagrid in function
Can I call functions of an Excel addin in C# project?
How do I know when an Image is loaded in Picturebox
Modify the content of the home page programmatically in SharePoint 2010
How do you fire the click event of a iwc:ImageButton in Jquery?
How to get type of the custom UserControl?
Returning to top of program to try again
What pattern is being done in the Global.asax.cs file in ASP.NET MVC 4?
Umbraco 4.8, Document save Publish
Converting some C# code to managed or C++/CLI code
DataTemplate for DataGrid

Categories

HOME
oauth-2.0
classification
repository
botframework
virtual-machine
cluster-analysis
window.open
liquibase
postsharp
salesforce-lightning
pandoc
opc-ua
artifactory
yuv
psexec
schema
sequence
promotions
unreal-engine4
http-status-codes
mbed
cucumberjs
views
single-page-application
git-branch
formulas
concatenation
uipath
handle
apdu
my.cnf
boosting
checkmarx
jbossfuse
undo
oracle-nosql
android-scrollview
traitsui
bootcamp
wit-ai
wunderground
pymunk
observer-pattern
azure-web-roles
collation
risc
npoco
serverless-architecture
react.rb
audio-fingerprinting
sharpdevelop
playframework-1.x
kendo-scheduler
jtextarea
tsc
timex
vertex-shader
android-music-player
distcc
universe
boost-range
networkstream
mate-desktop
scriptengine
magick.net
pebble-js
apache2-module
bluetooth-lowenergy-4.2
wiql
bioconductor
serial-communication
identifying
playn
nexusdb
backtrace
uiblureffect
growl
windows-search
oxygenxml
drawable
parallel-port
atg-dynamo
fastcgi-mono-server
html5-filesystem
mongoid4
boofcv
.net-reflector
maven-javadoc-plugin
dylan
caroufredsel
servicemanager
reference-manual
libx264
invalidoperationexception
winrt-async
erlide
mcpd
gmagick
file-processing
dongle
ihtmldocument2
cross-cutting-concerns

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