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()') } } ?> |
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()') } } ?> |
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
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(); ?>?> |
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; } ?>?> |