My Stuff

mgoodman Red Ribbon

Comments

  • In that case, the original code snippet I gave you was correct. You want to do a search on your custom record and then join on the item. Here's a more detailed example: var newRecord = nlapiGetNewRecord(); var recordID = record.getRecordId(); var filters = []; filters[0] = new nlobjSearchFilter('internalid', null, 'is'…
  • Hi Bushra, Here's how you would retrieve the descriptions for each item. Note that you will get a separate search result for each item selected in the multiselect field. var columns = []; columns[0] = new nlobjSearchColumn('description','custrecord_item_multiselect'); var results =…
  • You can always hardcode the list of countries into a switch/case function. Countries generally don't change much, so you don't need to update it very often, if at all: function getCountryString(countryCode){ switch(countryCode){ case "US": return "United States of America"; case "CA": return "Canada"; [...] } } Of course…
  • In a client script fieldChange trigger function, you check if the value is the one you don't want to allow. If it is, you alert the user and change the value to "", i.e. no selection. That's the simplest way of doing it.
  • Hi, I was able to load the project task and add an assignee line to it. The issue I see in your code is you inverted the last two parameters of setLineItemValue. From the Dev Guide: setLineItemValue(group, name, linenum, value) Here's my code that worked: var current_record = nlapiLoadRecord('projecttask',23);…
  • Well, you'll have to give more detail as to what this strange item is. What's its name? What is its internal ID? Also, I noticed that the line item doesn't commit unless you make the "synchronous" flag true. Here's some revised code which I tested and worked perfectly: function createLineAndSetItem( ) {…
  • Hi Julie, From the Dev Guide: nlapiSetCurrentLineItemValue(type, fldnam, value, firefieldchanged, synchronous) So you should try: nlapiSetCurrentLineItemValue('item', 'item', 14); You should always keep the Developer's Guide close to you when scripting :)
  • Did you try 'status'? A little trick few people know about: if you add "&xml=T" to the end of your URL while you're viewing a transaction record in NetSuite, it will give you the XML of the transaction, where you can usually find the field names you need.
  • Try iterating through the itemvendor sublist and looking for preferredvendor = 'T'.
  • I am trying to write a javascript code to be used in the Sales Order form. The scenario is this -- I am creating a letter template to be created from the Sales Order. The Sales Rep is mentioned in the letter, however, due to the way the system was set up and is used, all employees come out as Last Name, First Name in any…
  • Hi DMC, The library file is especially useful if you're reusing code in more than one script. Let's say more than one of your scripts creates generic phone calls, you could create a library function called "createGenericPhoneCall(customerID)" which accepts the customer ID and creates the phone call, instead of having the…
  • Thanks for your response yang, but my filter has to only let two values pass, not a range of values (which is what 'between' does as far as I know). The documentation says that 'any' is a valid operator for decimal number fields. How would I go about using it?
  • I don't see any easy way of doing this other than with a Suitelet. Suitelets aren't very straightforward, so I would highly suggest reading the Suitelet section of the Development Guide if you're planning on tackling this yourself. Play around with the sample scripts, there's actually some pretty good examples of how to…
  • The debugger only seems to be able to break on the BeforeSubmit. I noticed this as well. I have a script with a beforeSubmit and afterSubmit, and I can't find a way to let the beforeSubmit run, and break in the afterSubmit.
  • I finally found what the problem was. The billing schedule line items aren't available on afterSubmit, so I wasn't getting my billDate correctly. I tried just getting the date from the "nextbill" field and it works fine now. Here's the updated line of code: var billDate = newSalesOrderRecord.getFieldValue('nextbill');
  • I'm trying to generate the first bill on afterSubmit of a sales order, but I'm losing my line items. The nlapiSubmitRecord call fails, saying the new record doesn't have any line items. I've confirmed this with the Debugger. Here's my code: function afterSubmit(type) { if(type=='create'){ var newSalesOrderRecord =…
  • See this post for an answer: https://usergroup.netsuite.com/users/showthread.php?p=106854
  • Thanks John. For the moment we're simply going to add the line through a button that must be pressed before saving the record. It's not optimal, but it will do the job. I hope NS gets a chance to take a look at this.
  • On page 172 of the SuiteScript Developer's Guide, there is some sample code that uses 'equalTo' with the internalid. Here is the line in question: filters[0] = new nlobjSearchFilter( 'internalid', null, 'equalTo', customer, null ); This code doesn't work anymore, right? Will the Dev Guide sample code be updated to reflect…
  • Hi yang, I'm getting Unexpected Errors when using the "any" operator on Free-Form Text fields. Can you tell me how the "any" operator is supposed to work? Say, for example, I want to filter search results based on a text field containing the word "apple" or "banana" (or both). Is there a way to do that using a single…
  • Slightly off topic, but does anyone know the statuses for Invoices? Edit: I think it's just plain text for invoices after all.
  • I filed an online support case for this, because it's causing serious productivity issues for our client. Here is the workflow we're looking at: - Sales dept. creates SO, manually puts 0.00 in shippingcost - Shipping dept. edits SO, entering the actual shipping cost in the field - Billing dept. makes an invoice out of the…
  • Thanks Daniel, I will try that out today. Sounds like a viable workaround.
  • I'm currently using 2007.1 and I can't figure out how to set the shippingcost field. I can read the value fine with nlapiGetFieldValue(), but nlapiSetFieldValue doesn't update the field (or generate any errors for that matter). The reason our client wants to do this is to bypass the automatic shipping cost calculator, so…
  • Check out the different "For Purchase" Item records you can create. There's some stuff on there that you can't automatically set up using Expenses, such as a default Purchase Price, a Purchase Tax Code, etc. I think one of the biggest differences, in fact, is taxes. How does your company enter the taxes for these expenses?…
  • What kind of items are they buying? Do they need to track inventory? I would suggest taking a look at the Item record (whether it's Inventory, Non-Inventory, Service, etc.) and see all the different information that can be stored in there. There's a lot of stuff in the Item record that you simply can't get with Expenses.
  • Hi Steph, Try {netamountnotax}.
  • Though I haven't tested it, did you consider importing all the cases onto a dummy customer, and then changing the customer through a second CSV Import? That way all the creation emails would fall wherever you want. I'm not sure though if NetSuite sends a case email when the customer is changed on a case. And yes, this…
  • I can get the button on the screen and run a script, but I am having difficulty figuring out how to bill from script. In scripting, when you want to emulate a button press that transforms a transaction into another one (ex: Purchase Order to Item Receipt, Purchase Order to Bill, Sales Order to Invoice, etc.), it is…
  • It all depends on which fields you use within your company. If you don't track order weight and tracking numbers on your Sales Order, then you shouldn't have to enter them. Your best bet is to start off with some basic fields, start your import, see which fields are available in the mapping and continue from there.