How I get URL of a customer record in suitetalk by passing recordType and internalId - suitetalk

I am getting the customer records by passing the saved search script id and some filters in CustomerSearchAdvanced, but I want URL of each record also
example- recordType customer and internalId is 3645
URL is -- https://------.app.netsuite.com/app/common/entity/custjob.nl?id=3645

My organization chose to just hard-code the URLs for each record type and then append the internal id. Fortunately, all record families share a single URL that resolves to the specific record type URL based on the internal id. Here is an example of what I mean:
"/app/accounting/transactions/transaction.nl?id=1234567"
This URL format can be used for all transactions. Assuming that record 1234567 is a sales order, this resolves to:
"/app/accounting/transactions/salesord.nl?id=1234567"
If record 1234567 is an estimate, then this will resolve to:
"/app/accounting/transactions/estimate.nl?id=1234567"
Therefore, you will not have to hard-code URLs for each record type, just each record family. Here are some other family URLs:
"/app/common/entity/entity.nl?id="
"/app/common/item/item.nl?id="

Related

Graph API retrieve Sharepoint list with lookup field values

I have a Sharepoint list Region with a value that is a lookup field Markets that references Markets list.
I'm able to filter by the lookup ID:
https://graph.microsoft.com/v1.0/sites/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/lists/REGION/items?expand=fields(select=PVRegion,Markets)&filter=fields/MarketsLookupId eq 1
But I want to get some fields from Markets list with this lookup attribute, as PVOps, LinkTitle, ...
Is it possible to get this with only one query? Or I need to query Markets list with the LookupId?
Unfortunately you'll need a separate query to get those values. This is particularly frustrating when dealing with users since you only get the ID of the given user as it appears in the UserInformation list.

NetSuite formula to show quantity ordred on first order

We have a saved search in place that displays date of first order and last order by customer & item within a given date range. For example - Looking at sales for May 2022 - today, it shows the item, the customer, the date they first ordered the item, and the date they last ordered the item.
I am now also trying to incorporate the quantity ordered on the first order.
crietera
results
I've tried the following, but keep getting an invalid expression. Can anyone advise on how I might be able to display the qty on the date of the first order?
MIN(CASE WHEN {custbody_reporting_ship_date} THEN {quantity} END)
and
CASE WHEN (MIN({custbody_reporting_ship_date})THEN {quantity} END)
I think this can't be achieved in saved search via simple formula. You may want to try below, what I will do is try to record the first and last order id in the customer record, then from customer saved search you can source from these order fields to the order details.
Create 2 custom entity fields applied to customer
first order id => Type:List/Record => List/Record:Transaction
last order id => Type:List/Record => List/Record:Transaction
Create 1 saved search to get the first order id per customer
Similar to the one that you created, the result field just need the customer internal id and min(document number) and filter need to add customer.internal id
Create 1 saved search to get the last order id per customer
Similar to the one that you created, the result field just need the customer internal id and max(document number) and filter need to add customer.internal id
Create 2 scheduled workflows, to update the first order id and last order id fields in respective customer record.
Create your first and last order customer Saved Searches using the 2 custom fields to source for the order details.
Not sure if this help.

Duplicate results in NetSuite Contact search

Can someone help me understand why I get duplicate results on a Contact search in NetSuite only when I include a Customer field as a result column? Below are steps for how I am reproducing this problem.
Create a new Contact search
Add a single criterion: Internal ID is any of 230, 597, 1808
For results, return just a single column, Internal ID
Submit the search. 3 results are returned as expected (screenshot below).
Return to the criteria for the search
For results, add a second column, Customer : Internal ID
Submit the search again. This time six (6) results are returned (screenshot below).
What is incredible to me is not only are there double the number of results, but the results actually appear to be unique based on the fact that the Customer : Internal ID values are different. What causes this behavior?
It depends upon the field you give as result. If you many number of field in the result section, each result field that match your search criteria or filter will be shown irrespective of what is already displayed(ie,duplicates will be shown).
Use criteria to filter it out or reduce the result field
This is a similar interaction to the "main line" criteria on a transaction search. a contact is a record in itself. When searching for a contact it returns a singular one. As soon as you tell it to return an internal ID of a related document or customer you will find that sometimes a contact can exist in two places at once. So your second set of results basically says that (for example) Contact 597 is connected to customer 168 and customer 167. Contact records are not the same as a customer record.
Each contact has its own internal id, however, the same contact might show up to different records because NetSuite allows you to attach a contact to more than one customers/sub-customers. Therefore when you add customer: internal id it's pulling out all the customers that have the same contact on their records. You can add another column that shows the customer name/id under results and see if this is what happened.

Foursquare API: suggestcompletion near specified city

My aim is to find venues in specific city.
For this purpose i am using /v2/venues/suggestcompletion endpoint. So for example next request https://api.foursquare.com/v2/venues/suggestcompletion/?limit=10&query=McDonald&near=Napa,%20CA,%20United%20States&client_id=xxx&client_secret=yyy&v=20161118&locale=en returns venues not only in Napa, but also in Fairfield, Vallejo etc. Result for this query.
Ok, as far as I know what city I need I can filter result by city on my side. But in this approach I received next problem. Next query https://api.foursquare.com/v2/venues/suggestcompletion/?limit=10&query=Diviera%20Drive&near=New%20York,%20NY,%20United%20States&client_id=xxx&client_secret=yyy&v=20161118&locale=en returns venue in city labeled Brooklyn. Result for this Obviously New York string and Brooklyn does not match. Maybe somehow I can retrieve main city (New York) next to borough (Brooklyn) so I can filter it on my side properly
So my question is: how can I receives venues only in specified city.
The near parameter you're using is not a filter - it's a coarse geocoder that's used to generate a latitude/longitude to search near.
The search documentation does not show a way to limit results to a city name. If you only want to show results in a certain city you'd have to do that filtering yourself. Since the city name may be missing or incorrect (sometimes city boundaries are fuzzy) a more precise way could be filter based on the lat/lng coordinate.

Assert uniqueness in MongoDB

I'm using Node, Express and MongoDB (with Mongoskin) for a webbapp.
New client accounts are created through a web form, requiring inputs such as 'Company', 'Contact person', 'Email' et cetera...
When creating new clients there are some fields that have to be unique when saving to the database.
This inputs are: 'Company', 'Slug' and 'Email'
Company needs to be unique.
Slug is generated from the company name, and also needs to be unique.
Ex. 'Café Rosegarden' and 'Cafe Rosegarden' are two different company names, but will generate the same slug: 'cafe-rosegarden'.
Email. I think this need to be unique... but I'm actually not sure
Right now i have three single unique indexes on these fields.
Question 1: Is indexes the only (best?) way to assert uniqueness on a field?
Question 2: I'f im using a compound index, how does it handle uniqueness? Can i for example say that email only has to be unique in combination with one specific company name?
Yes, adding a unique index to a field is almost always the best way to ensure its uniqueness in the collection.
When using a compound index, MongoDB ensures that each doc in the collection has a unique combination of field values. So if you only had a compound unique index over company and email, you could have more than one doc with the same company or email, just as long as the combination of the two is unique.

Resources