84EM

  • Home
  • Projects
  • Clients
  • Contact
  • People
  • Blog
  • Jobs
  • Home
  • Projects
  • Clients
  • Contact
  • People
  • Blog
  • Jobs

Add button on form in Netsuite in view mode with SuiteScript

January 2, 2014 by Andrew Miller Leave a Comment

Via a User Event script:

1
2
3
4
5
6
7
<?php
function beforeload(type,form) {
    if(type=='view') {
        form.addButton('custpage_button','Button Label','on_click_function_to_call()')
    }
}
?>

Filed Under: Netsuite

Gift Certificate Payment Sublist (Suitescript, Netsuite)

October 7, 2013 by Andrew Miller Leave a Comment

Sublist ID:
giftcertredemption

Fields:
authcode (internal ID of gift cert)
authcode_display (display name for the gift cert code)
authcodeapplied (amount applied to this order. e.g. 6.95)
lineid

Filed Under: Netsuite

How to update a file in the Netsuite file cabinet with PHP

March 4, 2012 by Andrew Miller Leave a Comment

This assumes you are using the PHP Toolkit provided by Netsuite.

This is more for my reference, or the reference of someone already well versed in PHP and Netsuite. If you’re neither, feel free to contact me and I’d be happy to help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php<?php
// login to netsuite web services
$NS = new nsClient(nsHost::live);
$NS->login("username", "password", "company_id", "role");
 
// now gather the file contents
$file_content = file_get_contents($full_path_to_file);
 
// create an array of fields for our netsuite web services update
$fields = array(
    "attachFrom" => "_computer",
    "content"    => $file_content,
    "name"       => basename($full_path_to_file),
    "internalId" => $internalid_of_file
);
 
// create a new file object
$objFile = new nsComplexObject("File", $fields);
 
// send an update request to the file in the cabinet.
$response = $GLOBALS['NS']->update($objFile);
 
// error or no
echo ($response->isSuccess == true ? "OK" : "ERROR");
 
// logout from web services
$NS->logout();
 
?>?>

Filed Under: Netsuite, PHP

How to update a custom field on an item record in Netsuite using PHP

March 3, 2012 by Andrew Miller Leave a Comment

This assumes you are using the PHP Toolkit provided by Netsuite.

This is more for my reference, or the reference of someone already well versed in PHP and Netsuite. If you’re neither, feel free to contact me and I’d be happy to help.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php<?php
// login to netsuite web services
$NS = new nsClient(nsHost::live);
$NS->login("username", "password", "company_id", "role");
 
$boolCustFieldRef = new nsComplexObject('BooleanCustomFieldRef');
$boolCustFieldRef->setFields(array(
    "internalId" => $internal_id_of_custom_field,
    "value"      => $value_for_custom_field
));
 
$customFieldList = new nsComplexObject("CustomFieldList");
$customFieldList->setFields(array("customField" => array($boolCustFieldRef)));
 
$itemFulfillmentSetFieldsArray = array(
    "customFieldList" => $customFieldList,
    "internalId"      => $internal_id_of_record
);
 
$itemFulfillment = new nsComplexObject("ItemFulfillment", $itemFulfillmentSetFieldsArray);
 
$res = $NS->update($itemFulfillment);
 
if( ! $res->isSuccess ) {
    echo $res->statusDetail[0]->code . ': ' . $res->statusDetail[0]->message;
}
 
?>?>

Filed Under: Netsuite, PHP

Categories

  • Freeware / Open Source
  • HTML
  • Javascript
  • Linux
  • Magento
  • Netsuite
  • News
  • Perl
  • PHP
  • Ubuntu
  • Wordpress
Powered by
  • Home
  • Projects
  • Clients
  • Contact
  • People
  • Blog
  • Jobs

© 2019 84EM, LLC - A web development firm in Cedar Rapids, Iowa

Privacy Policy