Netsuite SS1 Cannot tell if inventory detail is set - netsuite

I have a workflow script that transforms a sales order into an item fulfillment when the order is approved.
I can create a subrecord for inventory detail no problem, but in some cases Netsuite will automatically set the inventory detail. In these cases, when I go to add a subrecord, I receive an error on fulfillment submit record.
I have tried for 2 hours and cannot seem to find a way only to verify if the inventory detail is existing. I tried using the examples from the documentation
var invDetailSubrecord = fulfillment.editCurrentLineItemSubrecord('item', 'inventorydetail');
var invDetailSubrecord = fulfillment.viewCurrentLineItemSubrecord('item', 'inventorydetail');
fulfillment.removeCurrentLineItemSubrecord('item', 'inventorydetail');
None of the above commands do anything and are ignored. I don't see any way possible to verify that inventory detail is set before creating it. Viewing the actual data isn't necessary.

You can use nlapiGetLineItemCount on inventory-details subrecord(I am using the same in SuiteScript2.0 and it works) before setting/updating records manually and if you get line count greater than 0, you can safely assume inventory details already exists for the line.
You can check this out for further reading.

Related

Netsuite - Add Dynamic Number of Records to a Custom Record?

I'm trying to figure out how to add a dynamic number of custom records to another custom record.
Basically, we have test result remarks that should be related to a test record. They can have any number of these remarks, but I can't figure out how to do that in Netsuite. I was thinking of adding a sublist, but it doesn't look like I am able to do this. I am VERY new to netsuite, so I apologize if this is really easy and I am just missing something, but can someone point me in the right direction?
I basically want it to be pretty easy to add records (was thinking of a sublist with inline editing where they can just add as many new defect record to the test as required. There are 4 pieces of information that need to be added for each defect. I created a separate Defect custom record. I want the user to be able to relate the test to the defect record, and to be able to add the defects pretty easily.
Thanks!
In your detail custom record
create a List/Record custom field.
make the list the parent custom record
check "Record is Parent"
After you save it you'd go to each test result remarks and select the appropriate test record. If you add them via the UI to the test record this will be done automatically. If you have a bunch of existing records and know which test record they belong to you can link those up via a script or csv import.
Netsuite actually works pretty well for this.
You can create a Test custom record and a Test Result custom record.
On your Test Result custom record definition, add a field of type List/Record and Record Type Test.
On that field's definition, check Record is Parent.
Then as instances of Test Result records are created, set their parent Test record appropriately in that field. This will automatically add a sublist of Test Results to Test records.

How can I trigger a NetSuite workflow on a Form Event (Client side event)

I want to trigger a NetSuite workflow when the user sets the value of a field, but I don't want to have them submit first. The Workflow state builder looks like it has useful options but I can't get it to work.
There's some useful looking blog posts around but a lot of them seem out of date.
Update - more info
My primary issue is this one: Restrict what customers an employee can see (NetSuite)
The hack I'm currently looking at is populating a custom Transaction Column Field that I've added to a custom Time Recording form. The idea is to load this field on the UI with only valid projects (not customers as well), and this I have been able to do.
The problem is I still (as far as I can tell) still need to populate the "Customer" field, which is mandatory; I'm also assuming that if I don't do that then any time that is recorded won't go against the project. I had thought that if the user selects the project they want then I can populate the customer field with that value. I hate this as an approach but I can't see how else to do it. I do have coding experience (including JavaScript) but haven't made the leap into SuiteScript yet.
You won't be able to do this in a Workflow, as they are currently limited to only work with body level fields and cannot modify Transaction Column Fields (aka sublists).
You should be able to achieve this with a Client Side Script though.
Source (Netsuite login required).
Sublist changes will be available for transactions in the 2018.1 release sometime in Feb/Mar.

Amazon MWS Api usage

I am using "http://www.amazon.de/dp/{ASIN}" to get product info.
But after getting response it doesn't return product "SellerSKU"
Is there any way that I can get "SellerSKU" of a product specified by "ASIN"?
I also had same situation.
And I found that there is only some limited way to get it.
https://mws.amazonservices.com/FulfillmentInventory/2010-10-01?Action=ListInventorySupply
ListInventorySupply api of Fulfillment Inventory lists returns information about the availability of a seller's inventory.
Request parameter includes SellerSKUs, QueryStartDateTime, MarketplaceId, ResponseGroup
Here you can omit SellerSKUs, and you can pass QueryStartDateTime.
Then you will get InventorySupplyList including SellerSKU and ASIN matches.
You should find the product's SellerSKU in this list.
But the problem is that it returns only available inventory list.
It will not work when product you are finding is not in available inventory list.
In this case you should make the user manually add SellerSKU in your application.
For more information, please take a look at http://docs.developer.amazonservices.com/en_US/fba_inventory/FBAInventory_ListInventorySupply.html
Hope this would help you.

Unable to find a matching line for sublist apply with key:

We are seeing failure to Netsuite while updating payments via the netsuite API,
the error message we see is as below Unable to find a matching line for sublist apply with key: [doc,line] and value: [123344,null] where 123344 is the external id of the bill.
Any ideas what might be the cause of this?
Note that SuiteTalk will give you this cryptic little message when you try to create a payment for an invoice that already has an Invoice:Paid In Full transaction status.
Don't get me wrong—it's good that NetSuite has this sanity check. I just wish the error was more helpful.
"Unable to find a matching line for sublist apply with key: [doc,line] and value: [123344,null]"
There is your problem, you can't match a line if you are not passing the line number.
We had the same problem inserting new payments, but it worked using the Internal ID for the Invoice column.
Note that the mapping specification is not clear on how to identify the Invoice when adding/updating payments for it. The API requires an invoice, and it works when you provide the Internal ID for the invoice.
I get this error when creating a customer payment. Below is my code. Make sure invoiceId is invoice's internal id and amount is less than or equal to invoice amount.
CustomerPaymentApply paymentApply = new CustomerPaymentApply();
paymentApply.setAmount(amount);
paymentApply.setApply(true);
paymentApply.setDoc(Long.valueOf(invoiceId));
We were getting this error with the Chargebee-Netsuite integration. The solution was to open the corresponding Accounting Period in Netsuite and rerun the sync.
The first number [123344,null] is the Netsuite internal ID of the affected document. If you navigate to the document in Netsuite and it has a padlock this could be the reason:
Open the Accounting Period for the affected document and rerun the sync. Setup/accounting/manage accounting periods:

How to create a Activity Feed Rule for emails automatically being assigned to a case in CRM 2011

How do I create an activity feed rule that writes an auto post on the Record Wall of a case when an email is automatically assigned (made Regarding) to that case because of its tracking token?
Our users are having trouble realising that there is something new to look at in the case and this would go a long way to preventing them from missing an important event.
EDIT:
These solutions have already been considered
They don't want follow up tasks.
The email is already displayed in a grid on the case
They don't want more Queues to check.
They don't want more emails to deal with.
This user is recalcitrant to say the least...they only want a note to appear on the record wall of the case.
To accomplish this with little/no coding, you could:
1) create a task or other activity that would show up on the activity feed. This is easily accomplished via workflow.
2) display the email/other activities in a grid on the case.
3) also set up queues to handle this.
4) send an email to the owner of the case when an activity gets appended to it.
There are a lot of options to resolve the issue of notifying users that their case has additional info.
EDIT:
Your comments are accurate and well received. Can't you do something as simple as create a workflow that will create a post when an email is created and/or when set regarding field changes. Then you can check within the workflow that the set regarding is for a case or else cancel the workflow. Within the post record, set the type to auto and the regarding to the same regarding as the email. (I was unable to get the record wall part working in my local VM, so I assumed that any post record regarding the case should show up in the case, but I couldn't test that).

Resources