My Stuff
Comments
-
Yes, it requires a bit more code though. You must add the button with a beforeLoad script, and then also do a form.setScript() to attach a client-side on the script. This script should call a Suitelet. The suitelet should execute all your code. You can then send a success response back to the button, which can then get…
-
nlapiAddDays() takes a date object as param, not a string. So you have to cast it back and forth. var due_date = nlapiAddDays(nlapiStringToDate(nlapiGetFieldValue('custentity_membership_paid_date')), 365); nlapiSetFieldValue('custentity_membership_due_date', nlapiDateToString(due_date));
-
Yeah - do NOT do this in client side. It'll be done in the blink of an eye then.
-
1. Must I always define in Script the filters and columns, or can I get those from the Saved Search (SS)? If so, how? A: If you're calling an existing saved search (i.e. specifying an ID in the second param) then you don't need to specify filters or columns, you get what is defined in the search already. If you DO specify…
-
response.write(myValue) Check out the nlobjResponse object.
-
nlapiRemoveSelectOption() and nlapiInsertSelectOption()
-
The response returns a single string. That string can be anything you want. For simple cases, you could define your own seperator logic. Say you have that scenario with var a,b,c,and d, you could return response.write(a+'|'+b+'|'+c+'|'+d) and then on the other side, when you get the response, you'd just need to do…
-
The intention of libraries is indeed to hold functions your main script calls, so this will work.
-
Can you post your code?
-
You can search on 'transaction' and then add filtering to specify Invoices and Credit Memo - a lot like you'd normally do in the UI.
-
No, just that your script is probably doing if(type=='edit'), and it needs to do if(type=='edit' || type=='xedit') Edit: I should add working with xedit is a real pain, as only submitted fields are present. So, it's unlikely a script not designed from the groud up to work for xedit would work without modification.
-
Two problems I quickly spot 1. Yes, your Load Record is bad. But, as you are in beforeSubmit, you don't need to load the record at all. Get rid of the nlapiLoadRecord() as well as nlapiSubmitRecord() 2. Your sales team contribution must equal 100%. You are setting a single line at 50%. That won't work. Either add another…
-
Don't do fieldChange, use Post Sourcing. If you do field change you run the risk of running your logic BEFORE your sourced fields are updated which would of course be pointless. To cover the situation when a user click on "create new SO" directly from a customer record, call your code in pageInit as well. You can verify if…
-
Correct, you would either have to make a special branching for 'xedit' only to take into consideration must field will be null, or you build a method that in 'xedit' cases loads the record to get correc values. However, loading the record won't work for regular edit since you would not get a fresh copy in THAT case. Or,…
-
Only the submitted field. See "SuiteFlex (Customization, Scripting, and Web Services) : SuiteScript : Scripting Records, Fields, Forms, and Sublists : Direct List Editing and SuiteScript" in the Help.
-
Scheduled Scripts and Suitelets (and Portlets too i think) trigger existing UE scripts on records they submit. A normal UE script deployed on a record does not. I think there's a section regarding this in the help, it probably has more details.
-
Hey Chris, Well, the native list/sublist UI components don't allow that. Buuut, if you really wanted to, you could build your own sublist machine using lots of javascript (well, using a javascript library, not like you're gonna hand-code the whole thing), and such a sublist could support reordering.
-
Yuo can't script that window. For clients who have asked us for various customizations to this pop-up, we have rebuilt the entire window from scratch using a Suitelet, THEN enhanced it.
-
As per the help documentation, nlapiGetNewRecord() contains only fields that were submitted (i.e. that changed value).
-
Do you also have code if FieldChange for this field?
-
If you're doing nlapiLoadRecord() and still can't read some values, I am very, very worried.... Try rolling it in the debugger to take a look at what the object contains. Even in the case of an xedit, nlapiLoadrecord() should ALWAYS return the complete record.
-
There is a beforeLoad trigger for 'email' We catch it try to redirect to our form, or else throw an error.
-
Not to my knowledge, that's more a Web Service app sort of thing.
-
You need to find a Web Services feed for your weather data. If you were in Canada, you could for example use this: http://media.theweathernetwork.com/web_datafeeds.php Such a feed can be requested using nlapiRequestURL(). You can then open the data package and do what you want.
-
Like 2 years ago I had to total the line items in a SO after adding taxes and thus doing some multiplications. I never got it to work until I used nlapiFormatCurrency() which led me to think, somewhere somehow, there was a fractionnal penny not being correctly rounded. So it's kind of experience based. I don't actually…
-
You can't call it behind the scenes with nlapiRequestURL()? Why does the window have to open if you're just going to close it?
-
Correct, all you can do is throw an error.
-
If you're dealing with currency I highly recommend using nlapiFormatCurrency() as this method can sometimes round values a little differently, as it's based on currency rounding rules which apparently differ slightly from mathematical rounding.
-
Please check this Help topic for your answer - "SuiteFlex (Customization, Scripting, and Web Services) : SuiteScript : Understanding NetSuite Script Types : User Event Scripts : Setting the User Event type Argument"
-
You want to verify type=='create' so this only runs once, on creation. Also, do not run this code in Client Side. You want to run this as a beforeSubmit. A client side version would almost certainly fail due to permission restrictions (unless your entire organization has access to Employee records)