Oracle NetSuite: How to get internal/external id from currency? - netsuite

I am a newbie of NetSuite developer.
We have some Currencies HKD/CAD/EUR/USD/CNY/SGD/GBP/AUD in accounting, and HKD is the base currency.
Now I want to add USD currency to all customer by importing csv, but don't know how to get information of USD currency:
RecordRef ccy = new RecordRef();
ccy.setType(RecordType.CURRENCY);
ccy.setInternalId("?"); // Don't know how to get internal id of USD currency
ccy.setExternalId("?"); // Don't know how to get internal id of USD currency
CustomerCurrency customerCcy = new CustomerCurrency();
customerCcy.setCurrency(ccy);
CustomerCurrencyList customerCcyList = new CustomerCurrencyList();
customerCcyList.getCurrency().add(customerCcy);
customer.setCurrencyList(customerCcyList);
updateCustomer(customer);
Please give some advise to me, thank you very much.

In you netsuite preferences, you can turn on the option for "Show internal ids." Once you have that set, the currency view should show you your internal ids. Alternatively, you can right click and go to developer tools in chrome or firefox and look at the internal ids on the elements.

Related

How to fetch the Finance Charge Preferences values using SuiteScript in NetSuite?

We need to perform calculations in SuiteScript using the values in Setup/Accounting/Finance Charge Preferences. Which record is this stored on? Specifically, we're looking for these finance charge fields:
Annual Rate
Minimum Finance Charge
Grace Period
We've tried to create saved searches in all of the obvious records but have not been able to find these fields.
Not documented but N/runtime can be used to get this info (at least in the console)
require(['N/runtime'], runtime=>{
const user = runtime.getCurrentUser();
console.log(user.getPreference({
name:'FC_GRACEPERIOD'
}));
});
You can get the field ids by clicking the field help on the Finance Charge Preferences page.
If that doesn't work to get the fields you can see if the fields are available but not documented by creating a server side script (I'd use a suitelet) to get the accounting preferences object and dump the field names.
If the config module was available client side this would be the console version:
require(['N/config'], config=>{
const conf = config.load({type:'accountingpreferences'});
conf.getFields().forEach(f=>console.log(f));
});

How display price in ml in Stripe API Checkout?

With Stripe API Checkout, does anyone know how to change what I underlined ?
I need to display a price in ml. Example: I must write /100 ml and not /piece
This value isn't customizable. I think the best way to handle this is to add the size to the product name, "Le Baume (100ml)".

Search payment records information in Netsuite using Suitelet

Need to get payment data from Transaction >> Payable >> Pay single vendor form and create a data file. This has been done with an eventscript (add button), a clientscript and a Suitelet by searching currentRecord data from client script to Suitelet and generated a file. However, searching Transaction record type could not get payer payment department and cost center data as I know. So any advice and recommendation from Netsuite experts on how can get these payer data from Netsuite with the existing Transaction information on the Bill Payment form, like payment check number, entity id, transaction number, etc ?
When using the N/search module the following 3 tools are invaluable for retrieving data from netsuite transactions.
Netsuite records browser (shows all of the fields, available search filters, and joins ect.)
https://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/script/record/vendorpayment.html
Another great tool is an extension called Netsuite Field Explorer developed by Michoel Chaikin
you can also turn on field ids in your account by navigating to Home->Set preferences->General tab->Set defaults->Show internal ids
(This will show the field id when you click on the field "What is this?" link directly on the record)
between the three you should be able to get everything you need to run a search and retrieve the data you are looking for.
Depending on your needs you can either search.create (return multiple records) or search.lookupfield(return a single record)

SUITETALK- Netsuite searchAdvanced gives line price in base currency

Can anyone please help us with this?
We are using Netsuite advanced search to pull sales order for different subsidiary. We are able to get all the line items(except tax itmes) but its consists the amount in base currency. Is there any way we can get response with exact amount visible in UI.
Also Its very hard to understand the basic of Netsuite SUITE TALk- SOAP. Do you recommend any resources that will ease learning?
Thanks
Just an update with this question, with Advanced search we are able to get the foreign currency of Subsidiary using fxCost in columns But line items doesn't have this option. This causes whole another problem for us. Then we decided to use SAVED SEARCH. Saved search provides us feature to disable foregin currency just by choosing CONSOLIDATED EXCHANGE RATE to none. We are using saved search ID in the Advanced search paramater ie using savedSearchScriptId from Netsuite Schema.
Hope it would be helpful to anyone who is strugglign with this kind of issue.
Thanks
For tax line in fx currency, prefer to do Tax Amount/exchange rate.

Find credit card by type and expiration date

According to this "Account Updater only works with Visa and Mastercard"
So I want to find customers whose cards are going to expire in the next month and are from a different type than Visa or Mastercard.
In the docs I see I can filter by expiration date, but nothing about cardType (it mentions cardholderName)
var stream = gateway.customer.search(function (search) {
search.creditCardExpirationDate().is("12/13");
});
Is there a way I can filter this in the api request or should I need to get all results and filter out Visa and Mastercard customers?
Thanks.
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
Both you and #michelem are correct: the current api doesn't expose a method for filtering customers based on whether they contain a specific type of card. Your approach of filtering the results based on the Payment method is the best approach.

Resources