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

.net core identity change tables names
Visual Studio - 'View Code' not working?
in nested root node how to delete one node particularly
Signalr 2 disconnects on method to ListAll in table, but can insert into table with Create method
parse file in C# with Regex and search lines
adding new property to asp.net identity role [duplicate]
Remove label for in div
Email confirmation link using office 365 in ASP.NET MVC [duplicate]
Calculate the size of a shadow
Call a web service from a desktop application in c#
Get members of custom class to read their values
Dynamically include/exclude fields in where clause LINQ
How do I send an Email using c#?
visual studio 2015 the following error occurred attempting to run the project model server process(1.0.3)
Stored procedure OUTPUT VARCHAR2 value truncated using 12c client
LINQ to Entities does not recognize the method 'System.String ToString(System.String)

Categories

HOME
airflow
webvr
ebay-api
hex
magento-1.9.2.1
servicenow
open-search-server
handlebars.js
box-api
rename
google-search-appliance
javascript-debugger
opendaylight
template10
google-street-view
novacode-docx
draw2d
klipfolio
mattermost
concatenation
waterfall
sasl
libxml2
marionette
launchd
mobile-development
selenium3
urhosharp
loopback
keil
ng2-bootstrap
ports
microstrategy
gstreamer-1.0
oracle-bpm-suite
stencyl
ngrok
keychain
tapply
contenteditable
uitextview
wufoo
smooth-streaming
nshttpurlresponse
taleo
ocpjp
android-doze-and-standby
geminabox
opos
jsfl
dotnet-cli
perldoc
webmatrix
liferay-ide
disassembly
catalyst
optional-parameters
android-tabs
easy68k
visual-web-developer
require-handlebars
bytearray
user-profile
razorengine
nugetgallery
ideavim
oryx
bluetooth-lowenergy-4.2
clear
first-order-logic
eaaccessory
xml-simple
litedb
firewire
transparentproxy
page-refresh
autopep8
bungeecord
service-broker
chrome-mobile
nsq
drools-guvnor
clearcanvas
go-gin
tigase
amzi-prolog
android-relativelayout
dayofweek
kernel-density
thucydides
cab
nsnumber
friendly-url
dynamic-expresso
azure-scheduler
antixsslibrary
mail-gem
report-viewer2010
backlight
mismatch
auto-compile
netbeans7.0
numerical-computing
glassfish-embedded
authkit

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