Setting Field Value in Customer Record after Invoice Creation - netsuite

In my customer record, I have a field called Membership Status. So the membership will change from Regular member to Prime member once a member purchase a particular item. Is there any way to update the field after the Invoice creation?
Thanks in advance!

Yes. Use an afterSubmit() event on a User Event script deployed on the invoice record. Search the invoice item lines for the item, and if found use record.submitFields(options) to update the field on the customer record.
If you are making other changes to the customer, you could use record.load(options) to load the whole record instead and then use the Record Object Methods to modify and save the record.
For updating a small number of body fields, submitFields() will usually be more performant, but if you need to manipulate sublists or subrecords, you need to load the record.

Related

Is it possible to have a custom field in Inventory Detail subrecord on Item Receipt? NETSUITE

Just like expiration date on inventory number subrecord on Item Receipt, can we have a custom field for manufacturing date in inventory number subrecord. Is there any feature need to be enabled? Does NetSuite have any functionality of Production/Manufacturing date? or any way to create a custom field in inventory number subrecord that is visible in IR subrecord?
As far as I am aware, it is not possible to add a custom field to the inventory detail subrecord. Checking the CUSTOMISATION > LIST, RECORDS & FIELDS NS menu (using the administrator role), this sub-record is not available. I have, however, in the past re-created the subrecord using a Suitelet and a saved search which auto-populates the item lines with additional columns. Perhaps this route is a potential solution for you too.
I have recently encountered this in an implementation. We were requested to add the Gross Weight and Net Weight fields in the Inventory Details window.
We used a SuiteApp called Lot Auto Number (Answer ID: 100706).

NetSuite - Sublist field as link

I have two custom records. They share parent-child record relationship. Child record is shown as sublist view. On Child record, there is a field called Delivery Order. It is a list/record field, But not having hyperlink to open that record. This field is list of a custom record of same name.
There is also a field called Sales Order#, it is a list/record field of Transaction. But it is shown as link which is right.
I want to have hyperlink for Delivery Order. I know that if I use a custom view, I can give a formula(text) field to show that field as a hyperlink, But I want to go with Default View only. I think because of Delivery Order is a custom record, they are not giving hyperlink.

Is their a way to set value for all existing records using Acumatica code without modifying the screen

User requirement is to create duplicate customer field in Invoice screen and that custom field is using for some historical data, But by default we are passing current Invoice customer value and later we are allowing user to change the custom field.
so in this case is there a way to set the value for existing records through code with out refreshing/modifying the existing record.
I have tried by using field level PXDefault attribute but that will not work in my case so their any events or some code to update custom field value for existing fields.
Thanks in advance.
I believe PXDefault would only execute when a new Row is being inserted. Perhaps one option could be to explicitly call cache.SetDefaultExt(e.Row) if value is null, but I am not sure whether it is 'legal' to do it on a row Selected
One other possibility is to use Generic Inquiry Mass Update (https://asiablog.acumatica.com/2016/09/mass-processing-using-gi.html). This way to could perhaps update past records in bulk. But be careful of Acumatica Transaction License limits.

Suitescript - How do I access the values in "Subsidiaries" sublist on vendor record?

On the vendor record, I need to loop over the Subsidiaries sublist through a scripted search, to get all of the values. I am specifically trying to find vendors that do not belong to a particular subsidiary.
UPDATE
To clear up my question, I was trying to access the Subsidiaries sublist and not the actual primary subsidiary. However NetSuite said that this is currently not possible and is a requested enhancement.
bluejay92, the vendor search has a join to the subsidiary record, see attach screen shot. You can even check "use expressions" to gain access to the NOT function in the criteria.
Workaround:
1 - Create a user event script that runs after the record is created/edited.
2 - Have the script load the record, get the subsidiaries and create a custom record to save the info so you can search it later.
3 - Export all vendors internal ids in 1 column. Run a CSV import of vendors and map internalid csv column to internalid field to trigger the user event script and populate the custom records.
Extra tip: Make sure the script does 'upserts' to the custom record to avoid duplicates. There should be one record per vendor.

Custom Record For suitelet Sublist -Netsuite

I have a requirement where i should display the details(values) of the custom record in the suitelet sublist.
Now i have to create a custom Record with two fields. One field would be bill payment and other field will have list of bills related to bill payment.
When i create a custom record what should be my field vaues's type?
Appreciate any help.
I would suggest to keep one field of type List/Record and Record option to "Transaction", and second field of type Multiple Select with record option to "Transaction".
Since, the fields can hold reference to any transactions I would recommend writing a user event script which would fire on create/edit and validate that the fields value are always correct.

Resources