My Stuff
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Comments
-
That didn't work either. Tried a few things and finally figured it out... var records = new Array(); records['recordtype'] = '20'; records['entity'] = ''; records['record'] = recordid; nlapiSendEmail(1, custemail, emailsubj, emailtext, null, null, records); Thanks Yang, for all the help :)
-
Another example: var filters = new Array(); filters[0] = new nlobjSearchFilter( 'internalid', null, 'equalTo', XXX, null ); var columns = new Array(); columns[0] = new nlobjSearchColumn( 'custrecordcustomer' ); var searchresults = nlapiSearchRecord('customrecord62', null, filters, columns); searchresults = searchresults[0];
-
That worked :) Thank you so much... Your help on this forum is much appreciated!
-
Hi Yang The 'customer' filter worked !! I am now 95% done with the code. If a PO # is already used, I want to throw an error and this is what I have: if (...) { ... nlapiCreateError('ERR_DUPLICATE_PO', 'This PO# has been used before. Enter a different one.'); return false; } This piece is getting ignored - doesn't throw…
-
Thanks Yang! I tried this: nlapiSendEmail(1, custemail, emailsubj, emailtext, null, null, recordid); The email came thru but was not attached to the custom record (recordid contains 2 which is the Internal ID of my custom record) . Interesting enough, my email got attached to a customer with Internal ID 2 !! How do we fix…
-
Thanks Brian. Your idea worked like a charm :)
-
Your code is not going to send out an email. All it does is create a message record and associate it with an entity and a custom record. In order to send out an email and associate it with a custom record, you will need to use the nlapiSendEmail function. Thanks Yang! I was under the impression adding a message would auto…
-
Hi Yang, I am not sure if that would work - let me explain a bit more. I have a custom field on the JOB record to store the Customer's PO number. when a new job is created I need to ensure that the PO for this job is not already used. So I thought I could put in two search filters : filters[0] = new nlobjSearchFilter(…
-
I am trying to add to the "Messages" of a custom record and doesn't work. No errors but no emails either! .. var newRecord = nlapiGetNewRecord(); if ((newRecord.getFieldValue('custrecordsend_email') == "T") && (newRecord.getFieldValue('custrecordpartner_contact_email'))) { var recordid = nlapiGetRecordId(); var custemail =…
-
I can't do that as these lists are linked to Matrix Items :(
-
I managed to get this to work last week, but its broken today. Any ideas where I'm going wrong?? for (i=1;i<=nlapiGetLineItemCount('item');i++) { nlapiSelectLineItem('item', i); nlapiSetCurrentLineItemValue('item', 'custcolparent_item', "x"); } nlapiCommitLineItem('item'); I am using this code in a Save Function client…
-
Yes, I did try with the nlapiCommitLineItem within the For loop and that doesn;t work either
-
We use Inventory items where the code works. The problem account has Matrix Items. Could that be the issue??
-
Hi Yang Thanks for that - this code now works perfectly for one of my clients. However, it doesn't work in another account. Let me explain - The issue is that we need to use the Add Multiple button which fails to source fields from the item selected and does not perform the code in the Validate Line function. So I have…
-
Thanks for your post - I basically need to look up the internal ID of the individual entries in a Custom List (under Setup -> Customisation -> Lists) within a client script. So its a different from what you've posted. Any other ideas?
-
Hi Yang, Is it possible at all to get the IDs of custom list elements from within a client script? I tried using nlapiSetLineItemText instead and that gives me an unexpected error! nlapiSetLineItemText('item', 'custcoltempsize', i, sizecol[2]); nlapiSetLineItemText('item', 'custcoltempcolour', i, sizecol[1]); Is this a bug…
-
I thought I would try one last thing before writing to support - use nlapiSetLineItemValue instead of using nlapiSetCurrentLineItemValue and its partly working now... for (var i=1;i<=nlapiGetLineItemCount('item');i++) { nlapiSelectLineItem('item', i); var item_name = nlapiGetLineItemText('item', 'item', i); var…
-
I also need to extract the Created Time for some custom records. TO_CHAR({created},'HH24.MI') returns ERROR: Invalid Expression. Am I using the right fieldname??
-
Thanks Yang! That worked! But one strange thing - we are on an Australian account and the preferred Time Zone is set to our time, and yet the record creation time and the current time come up with the US time instead!
-
I get the error on a custom field. After reading your response, I tried it on a search field and that works.
-
No, this also returns the US time!
-
Oh! Mine is a new script I wrote on 31/10. Never worked so far :(
-
Thanks Yang, that was indeed one of the problems! After I fixed this, I started to get Unexpected errors - I had to use nlapiSubmitRecord(record, true); Do we always need to add in the "true" in submitrecord? Another thing, the tax code comes up as "UNDEF" irrespective of what I specify in the script. Any ideas why?? Many…
-
I managed to get around this error, but I have a new problem now. My code executes till the last line and fails at submit: function invoiceAfterSave(type) { if ((type.toLowerCase() == 'create')) { var newRecord = nlapiGetNewRecord(); if .... { var record = nlapiCreateRecord('invoice') record.setFieldValue('entity',…
-
Submitted a case for this - case # 499715. Thanks!!
-
Thinking of it, i feel my problem may be linked to issue # 115210 as well. My code is quite similar to the one posted in the other thread and that worked well without a "commit" line. So maybe I'll wait for tomorrow's release and see if it gets fixed.
-
Any ideas? Has anyone successfully created a new invoice from scratch using serverscripts?
-
Hi Evan, The user time zone was "(GMT+10:00) Sydney, Melbourne, Canberra". I have raised a case with support today - # 502895
-
I tried it yesterday itself. I think "nlapiCommitLineItem(type) is a client script function rather than a serverscript one! Date & Time: 11/1/2006 3:43 pm Record Type: Invoice Internal ID: 15 Execution Time: 0.18s Script Usage: 10 Script: invoiceAfterSave Error: UNEXPECTED_ERROR ReferenceError: "nlapiCommitLineItem" is not…
-
Try this and see if it helps.. filters[0] = new nlobjSearchFilter('entityid', null, 'equalTo', customer_id, null); filters[1] = new nlobjSearchFilter( 'orderstatus', null, 'equalTo', 'Pending Fulfillment', null); var searchresults = nlapiSearchRecord('salesorder', null, filters, null);