My Stuff
Comments
-
You'd probably have to create an entire custom form. If the manufacturing date is the same across all inventory detail sub records, then you can also think about putting it on the line as a custom column field. You'd be updating the inventory number record in a user event script after submission anyway most likely as you'd…
-
There is a contactrole field on the contact record object. You can set that to whatever role you need. You'll need to reference the internal IDs for the contact roles in your CRM Lists.
-
You could use nlapiRequestURL() and GET/POST accordingly.
-
Knew I had an example somewhere... var search = nlapiCreateSearch('recordtype',filters,columns); var resultSet = search.runSearch(); var indexID = 0; do{ var results = resultSet.getResults(indexID,indexID+1000); for(var x=0; x < results.length; x++) { INSERT YOUR LOGIC HERE.... indexID++; } }while(results.length >=…
-
Can you use the customer internal ID instead of the string email address in the "To"? There was a limitation regarding that and tracking, but I can't remember the details.
-
You can use a search and use the Applied To Transaction join to get the link between the line items on the item fulfillment and the sales order. There is a Line ID field on the SO that you can use if you need to go back and set fields on it.
-
Yes, you can create a script that will print the record and one of the parameters is to include the specific form you want to print. You need to create a new Transaction Form PDF and Transaction Form (basically copy the preferred form now, don't make it preferred, and link to the new PDF). Keep in mind though that this is…
-
Look at using the new search APIs using the nlobjSearch objects. They let you run a search and return results in blocks up to 1000 rows at a time. You do not need to sort these by internal ID though like you had to in the past.
-
It depends what kind of script you're trying to deploy. You can apply user event scripts to Inventory Transfer records, but you cannot apply client scripts. There is currently no way to customize the form like you would a purchase order, etc. You can use a Before Load script with some of the NetSuite UI functions to…
-
The filter (nlobjSearchFilter) in a search built via script is equivalent to the criteria in the UI. While there are benefits to using saved searches kept in the UI like being able to view results easily in debugging, easily editting criteria, etc., I don't think performance is a big one. I haven't read any firm technical…
-
Client scripts can only run in the role of the user logged in. There is no way to execute as admin like user event, suitelets, etc. One workaround might be to create a Suitelet that runs in Admin mode and looks up the Item Account Code and returns it. You could call that using nlapiRequestURL from your client script.
-
I haven't tested this, but it looks like it will work. It looks like there is a unique record grouping for items w/ bins & serial/lot numbers. You can do a search on {inventorynumberbinonhand.inventorynumber} and filter with the serial number and then return the bin number in the same format…
-
The if statement syntax is a little off: function trans_lineInit() { if(nlapiGetRole()=="1038" || nlapiGetRole()=="1033") { nlapiDisableLineItemField("item","price",true); nlapiDisableLineItemField("item","amount",true); } }
-
Are you referring to a Bin Transfer? Using an Inventory Transfer, you should be forced to select two different locations. Nonetheless, you'll want to look up using SuiteScript with Advanced Bin Management in the NetSuite help and get some code samples for subrecords. You'll need to create the inventorydetail subrecords for…
-
You need to look under the Inventory Detail record in the records browsers (make sure it's a current version). I do not see the "to" one in there for some reason though.
-
Here's a bit of an example. You'd do this for each line item. transfer.selectLineItem("inventory",x); var subrecord = transfer.createCurrentLineItemSubrecord("inventory","inventorydetail"); subrecord.selectNewLineItem("inventoryassignment"); subrecord.setCurrentLineItemValue("inventoryassignment","binnumber",FROM_BIN);…
-
When calling window.open, set the parameter dependent=yes (set this where you set the order parameters such as width, height, scrollbars, etc.) Then at the end of the Suitelet (POST I'm assuming), write back some JS to the screen via response.write() similar to the following which will call client-side NS APIs on the form.…
-
The variable "type" is not defined. It looks like you want this to be a pageInit function instead of save record? If that is the case, you'll want to be sure you're receive the type variable into your function (i.e. function saveRecord(type)......)
-
getAllFields() will return a list of all the fields on the record (this can different depending on context and where you get your nlobjRecord object from) including a bunch of system fields that are probably unnecessary. It will work for your use case though I believe if you wanted to go that route.
-
Hi Ben, There are a couple of ways you can do this; however, most will involve checking field values with some type of condition statement. Depending on your script type (user event, client, suitelet, etc.) will depend on what's most appropriate. nlapiLoadRecord or nlapiLookupField will work good on most but client. If you…
-
You can call nlobjRecord.getAllFields() but there is no getAllFields() API call I can find linked to the form object itself. Calling it on the record will return a keyed array of all fields on the record.
-
You can do it with a formula using the TO_CHAR function on trandate. The following would be your formula. TO_CHAR({trandate},'YYYY') Alternatively, you could specify the dates of the start/end of the year without using a formula. nlobjSearchFilter('trandate','null','within','01/01/2013','12/31/2013')
-
You'll want to create an nlobjSearchFilter object to filter the date. var filters = []; filters[0] = new nlobjSearchFilter('trandate',null,'within','thisyear'); You can then use that filter array in your search API call.
-
You'll need to do this in two steps, you're pretty close. First, grab the internal ID of the vendor record in your post source Second, use either nlapiLoadRecord or nlapiLookupField to grab the vendor field from the vendor record. function postSource(type,name) { if(type=="itemvendor" && name=="vendor") { var vendorID =…
-
var recordid = nlapiGetRecordId(); var recordtype = nlapiGetRecordType(); var template = nlapiMergeRecord(TEMPLATE_ID,recordtype,recordid); nlapiSendEmail(EMAIL_FROM,EMAIL_TO,template.getName(),template.getValue()); Note: template.getName() = Subject template.getValue() = body of email This can be done in a variety of…
-
You can do it using regex: var custbodyremarks= recEST.getFieldValue('custbodyremarks'); custbodyremarks = nlapiEscapeXML(custbodyremarks.replace(/\n/g, '<br />'));
-
Regardless of what script type this is deployed in (i.e. user event, suitelet, etc.), the current record details coming from merging a record (or records) into a template using nlapiMergeRecord. When you create your email template, you can add dynamic tags like you would for one being used within the UI. When using…
-
You need to format the line breaks. They are currently in as either \n or \r (can't remember which one) and need to be converted to <br/> tags so the line breaks so up properly. Using RegEx you can write a small utility function that will handle this nicely for you.
-
Yes, NS already has the libraries for ExtJS (can't think of the version off the top of my head, I believe jQuery too now, and some other libraries.
-
kphu, The options for the custom form should be a hastable. var options = new Array(); options.formnumber = 131; nlapiPrintRecord('TRANSACTION',tran,'PDF',options)