My Stuff
Comments
-
Somewhat unrelated, but we have a defect open (#161954) where using nlapiCopyRecord() on Campaigns consistently throws an Unexpected Error in a server-side script, but by the sound of it you got it to work. I'll have to test it again to see if it works now. As for your issue, one thing to note is apparently you can only…
-
Reports aren't exposed to scripting or web services. As WalterM mentioned, at the moment your best bet is probably using a Web Query, then using Macros within Excel to do what you need. Or, alternatively, try to reproduce your report in a Saved Search or through scripting.
-
Are you sure it used to work before? I was under the impression that batch fulfilling never triggered User Event scripts.
-
Technically, the correct syntax would be: if(condition1){ code1; } else if(condition2){ code2; } In post #3 you only had "else". In post #4 you only had "if". The correct syntax is "else if".
-
I tried the else if and it would not work at all so in desperation hunted through the help files and found this: function pageInit_getFieldTextTest() { var departId = nlapiGetFieldText('department'); if (departId == '') { alert('Please specify the Service department'); } if (departId == 'Sales') { alert('Please select the…
-
Well, for one thing your for loop definition should be: for(var i=0; i< GFV.length; i++) In other words, remove the "=" in your condition to stay in the loop. Otherwise you'll always be pointing at a null or undefined value at the end. For example, if GFV.length is 2, you want the loop to go through GFV[0] and GFV[1],…
-
They are still unaccessible. The only way I know of to access them is through Web Services. Your best option at the moment is to keep a custom list manually in sync with the true accounting list.
-
Try this: ROUND(({today} - TO_DATE('01011970','MMDDYYYY')) * 86400 * 1000)
-
If I'm not mistaken, nlapiLookupField can only see Search Columns. Some fields are only available when you actually load the record using nlapiLoadRecord.
-
No, you have to check every time if it's the price level you want using an if statement.
-
Well, it all depends on your customer's role permissions. You would have to either customize the customer's role, or the custom field (check out the Access tab when editing the field).
-
Scheduled Scripts always run at Pacific time. There's no way to change the time zone. So in other words, based on your instance's time zone, you must add or subtract a certain number of hours to the PDT time to get the correct time.
-
Try this: columns[0] = new nlobjSearchColumn('pricelevel', 'pricing'); columns[1] = new nlobjSearchColumn('unitprice', 'pricing'); That will return a result for each price level. You can also create an nlobjSearchFilter on ('pricelevel', 'pricing') to limit your results to a specific price level.
-
results[i].getValue('item'), where i is the line number. Note that the order might not be the same as the one in the UI.
-
You simply specify the column you want, and make sure your search returns line items by NOT having Main Line True in your criteria.
-
nlapiSearchRecord(type, id, filters, columns) "id" is the Internal ID of the UI Saved Search you want to use. You can then add "filters" and "columns" as you normally do in scripting, and those will be added onto the UI Search filters and columns.
-
The following thread should help you out: https://usergroup.netsuite.com/users/showthread.php?t=12153
-
Try the following: var pricingLineID = 5; var filters = new Array(); filters[0] = new nlobjSearchFilter('isonline', null, 'is', 'T'); filters[1] = new nlobjSearchFilter('pricelevel', 'pricing', 'is', pricingLineID); ... //other filters var columns = new Array(); columns[1] = new nlobjSearchColumn('unitprice', 'pricing');…
-
You can't create formula fields in scripting. If you absolutely need a formula field, you have to create a UI Search and then use it in your script.
-
I'm sorry, I don't know what you mean by "specific category line", but here's an example if you want to retrieve each line item in a Sales Order: var filters = []; filters[0] = new nlobjSearchFilter('mainline', null, 'is', 'F'); var columns = []; columns[0] = new nlobjSearchColumn('item'); var results =…
-
Yep! Any filters you pass to the nlapiSearchRecord function will be added onto the UI search filters. Note that if the UI search is using Expressions, you may get strange results.
-
There are certain cases where the validation logic between the User Interface and Scripting are different. For example, a script will never let you submit an invoice with 0-quantity line items, even though the interface will generate 0-quantity line items for you if you have the "Show Unfulfilled Items on Invoices"…
-
Well, it's not so much the line item amount as the total amount that I would be concerned about. Is your transaction total below 0$?
-
but When I use results[0].getValue('itemid') It returns null, any ideas regarding that? When you do your getValue(), you must specify the join, just like in the SearchColumn: results[0].getValue('itemid','custrecord_item_multiselect'); EDIT: Looks like I need to read entire threads before posting! Thanks yang!
-
What do you need to do with the items once retrieved?
-
Yang, correct me if I'm wrong, but I don't think the External ID can be edited in Client Scripts. You have to do it in User Event or Scheduled Script. Also note that the correct way of converting Dates for NetSuite is to do the following: var today = new Date(); todayString = nlapiDateToString(today);…
-
I tried out using record.setFieldValue('externalid', 'externalidvalue') and it worked fine. What context are you using this in? What kind of script? Which event?
-
If you only want results with items, you should remove the mainline from your search by using the following filter: filters[1] = new nlobjSearchFilter('mainline', null, 'is', 'F'); Once you do that, results[0] will be your first line item result as it should be. That's also why results[0] was not returning any item…
-
That's a very simplified example. Depending on your needs, you may want to limit the results to a specific record of your custom record type or add other filters.
-
First, when posting code on the forums, I would suggest using the PHP tags. It makes reading code much easier. To use them, when entering your message select your code and click on the little "PHP" icon above the message edit window. As for your problem, you need to do something with the response object, or call the…