My Stuff
Comments
-
You can create a Suitelet and print the output to the screen using response.write(file.getValue())
-
nlapiPrintRecord allows you to set a custom form parameter so you could create a custom button or something and print to screen using the form of your choosing
-
nlapiSearchRecord should work. Make sure if you are not using a saved search that you are defining the item column in your search definition as an nlobjSearchColumn object. You can do the same for any other column in that sublist (quantity, rate, amount, etc.). Also make sure you are not filtering mainline=T
-
I've done this on one occassion scripting the creation of a vendor bill. From my testing, I've found that this method only works when linking initially (i.e. you cannot take an existing vendor bill and link line items back to a PO). I did it by setting two fields on each line: orderdoc - internal ID of the purchase order…
-
You might be able to using the search API and pulling data from a saved search. I've haven't tried it though so can't say 100%.
-
The below might get you started. This is assuming that the field custbody_celigo_magento_pay_meth is a text field. function afterSubmit(type) { if(type=="create") { if(nlapiGetNewRecord().getFieldValue("custbody_celigo_magento_pay_meth")=="sagepaydirectpro") { var cashsale =…
-
The API call nlapiGetNewRecord() returns a read-only copy of the read. Therefore, you cannot use any setter functions of the nlobjRecord object. If you want to edit the record, you'll need to call nlapiLoadRecord() or use nlapiSubmitField()
-
new nlobjSearchColumn('SALESORDERFIELD','appliedtotransaction');
-
There is an nlapiStringToXML() function within SuiteScript.
-
I've done this via custom fields already. Creating a custom inline HTML field, adding that field AFTER the subtab/tab I want to hide, and putting some JS code in there to hide the element (document.getElementById('....').style.display='none';). It's definately a "hack" solution and should only be used when extremely…
-
Since you're loading the record, all of your nlapiGet.... calls should be from the return nlobjRecord object Example: var kit = nlapiLoadRecord('kititem',kitId); var lineCount = kit.getLineItemCount('member'); Similarly with your line item processing, kit.getCurrentLineItemText() kit.getCurrentLineItemValue() ...and so…
-
To add a button in view mode (works for edit too), you need to create a user event script running on the Before Load event. The script function takes two parameters as shown below. If you want to restrict your button to just View mode, you can filter on the type parameter. function beforeLoad(type,form){…
-
Is custentitysc_type a custom field of List/Record or Multi-Select?
-
Sorry, left a piece off the earlier code for the button...try the following form.addButton('custpage_button','Tech Services Survey','window.location.href="'+strURL+'&custparam_customerId='+intCusID+'"'); The user event one should execute in both view and edit as long as the type if statement includes both
-
Yes, with the exception you'll want to == instead of one = in your if statement. For the isPro function, you'll be getting back an array from nlapiGetFieldTexts() so logically you would loop through that comparing to your values such as: for(var x=0; x < proSupport_set.length; x++) { switch(proSupport_set[x]) { case…
-
nlapiLookupField('contact.custentity30'); This statement would need to be done as follows: nlapiLookupField('contact',nlapiGetFieldValue('contact'),'custentity30');
-
your call to nlapiLogExecution needs parameters nlapiLogExecution(type,title,message); Example: nlapiLogExecution("debug","Done script","Script has completed..."); I'm not sure if that's the exact error or not. Everything else looks in place I believe. Note: if this is running as a user event script, your JavaScript…
-
What record type is this script running on - customer or contact? Your calls to nlapiGetFieldValue are invalid. When using nlapiGetFieldValue(), you can only see the fields on the present record; it does not support joins. If you needed to do a join, you could use nlapiLookupField() which gives you a little more search…
-
Given that, I'd replace var proSupport_set = nlapiLookupField('custmomer.custentitysc_type'); with nlapiGetFieldTexts('custentitysc_type'); This will return an array of string values that the user has selected. You'll still need your isPro function, but you'll probably want to add another layer of looping in there to check…
-
I think you'll have to move this variable around var proSupport_set = nlapiGetFieldTexts('custentitysc_type'); You can define the variable globally, where it is now. However, instantiate it within your main function. var proSupport_set; or var proSupport_set = []; ..... function psTrigEmail(type) { proSupport_set =…
-
The nlapiLookupField call takes 3 arguments: nlapiLookupField(record_type,record_id_,[fields_array]) The fields array can be comprised of join.fieldID, but you still must have the other two values in there. Is this being deployed on the customer record?
-
You would want to use nlapiCreateRecord() to build the task record and contents. Since you already have the ID of the opportunity, you can link it directly to the task by setting the 'transaction' field to the opportunity ID: task.setFieldValue('transaction',recId); Then use nlapiSubmitRecord() to submit your task record…
-
Try using nlapiGetRecordId() instead of nlapiGetNewRecord().getId()
-
You should be able to just place the XML in a string within your code. I've done this on a few situations using nlapiRequestURL, and it has worked fine. It could just be something with the JS alert() function stripping out certain characters. I've usually just wrote the XML to the screen via a Suitelet when developing.
-
I'm having a similar situation on an inventory adjustment - adusting out quantity 1 from a location. When I enter -1 into the quantity field on the inventoryassignment subrecord sublist, I receive an error that it doesn't like -1 or -1.0. If I switch to positive, then it wants a negative. Nothing seems to work - parseInt,…
-
A good resource and reference is www.w3schools.com. If you're just starting off, you'll probably want to grab a book, but this can provide some building blocks and is a good, quick reference down the line.
-
check your usage with each iteration...you already do this but compare it to something higher than 0 probably 20. One it hits that stop the current loop and reschedule a new script.
-
See the following below as a guide. Capture all of your internal IDs into an array and then search on the item's internal ID using the 'anyof' operator. One call to nlapiSearchRecord is only 10 units. var itemIDs=[]; var str=''; var members_count = nlapiGetLineItemCount('member'); for(var i=1; i <= members_count; i++) {…
-
Return and capture the internal ID of the items. Sort your search on internal ID and then based on the internal ID of index 999, use that as a filter for your next iteration such that internal ID > index 999 internal ID and keep looping like that going forward until the search returns less than 1000 results. This will…
-
You might be able to dig up the ID in the source code. I believe I've done this previous with custom sublists. What specifically are you looking to do?