Duplicate results in NetSuite Contact search - netsuite

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.

Related

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.

Prevent duplicates across multiple sublists

Our organization runs a daily transaction list (via saved search) to forecast our opportunity pipeline. For this saved search, we set the customer mainline to false to eliminate duplicate values in our search.
I've built a saved search text formula that references the customer sales team, which I understand is a sublist. This sublist doesn't play nicely with my transaction report and results in duplicate values.
What I want to have happen is for the transaction line item to pull in the name of the sales team member who has a sales team role of "team lead". If there isn't a sales team member with the team lead role, then I want the result to be blank. We do not have any sales teams where there are two team leads, so we will never run up against this.
The problem I'm getting is duplicate values. The report interprets my code to mean if a customer has a sales team member with the team lead role, then duplicate that line item as many times are there are sales team members. As an example, I have a customer with 8 sales team members. My code results in 8 duplicate line items and one line item has the name of the team lead while the rest are blank.
Thoughts on how to resolve? Thank you in advance. My code looks like this:
I cannot change customer main line to false, as this is makes it even more complicated. Leaving customer main line as false displays exactly what I need currently, with exception of the name of the team lead.
CASE
WHEN {customer.salesteamrole} = 'Team Lead'
THEN {customer.salesteammember}
ELSE NULL
END
What I'm looking for is one line item for each transaction and simply the name of the team lead on that transaction. Perhaps the answer is to create a custom field, but I'd like to think the solution can be accomodated in a transaction report.
You can set a filter in the Criteria tab to make sure only the lines that you want are returned. In the Criteria tab under Filter, select the Formula (Numeric) option, and set the Formula to be:
CASE WHEN {customer.salesteamrole} = 'Team Lead' THEN 1 ELSE 0 END
then choose 'equal to' in the operator field and put 1 for the value.

Microsoft Graph API $filter=name eq 'foo' query not working on GET workbook/tables/{id}/columns. No error and no filtering

I'm looking at a table (Table1) inside an Excel book saved on my OneDrive for Business account. I then want to get the maximum value in the CREATEDDATE column from this table.
I want to avoid pulling down the whole table with the API, so I'm trying to filter the results of my query to only the CREATEDDATE column. However, the column results from the table are not being filtered to the one column and I'm not getting an error to help troubleshoot why. All I get is an HTTP 200 response and the full unfiltered table results.
Is it possible to filter the columns retrieved from the API by the column name? The documentation made me think so.
I've confirmed that /columns?$select=name works correctly and returns just the name field, so I know that it recognizes this as an entity. $filter and $orderby do nothing when referencing any of the entities from the response (name, id, index, values). I know that I can limit columns by position, but I'd rather explicitly reference the column by name in case the order changes.
I'm using this query:
/v1.0/me/drive/items/{ID}/workbook/tables/Table1/columns?$filter=name eq 'CREATEDDATE'`
You don't need to $filter here, just pull it by the name directly. The prototypes from the Get TableColumn documentation are:
GET /workbook/tables/{id|name}/columns/{id|name}
GET /workbook/worksheets/{id|name}/tables/{id|name}/columns/{id|name}
So in your case, you should be able to simply call call:
/v1.0/me/drive/items/{ID}//workbook/tables/Table1/columns/CREATEDDATE

NetSuite: PO Rate in Saved Search

I am trying to pull the PO Rate in a Saved Transaction search. This is a built in field on the Sales Order. When I pull it in to the search, it shows no data for Sales Orders that clearly have it if you go to the record. I have tried pulling it by selecting the Field and by using a formula to pull the Field ID (porate). Nothing seems to work. These are Sales Orders without a PO at this time, but the Po Rate field is populated and we need it extracted.
We need this for an upload of data. I know this seems like an easy task - and we thought it would be. Anything you can advise is appreciated
If the line item has "Created Po" i.e. it has special order lines or Drop ship line items , the field "Po rate" has value and it does gets pulled into Search Results.
Also, there are extra lines in search results for shipping and taxes which will not have "Po Rates". Also, you may want to apply filter mailline is false, as porate is line item field

Show specific document on top in search for specific keywords in solr

Suppose, I have 1000 sellers (S1.....S1000) of Apparels listed on my site. Since all the sellers are paying some amount to me, I am giving them equal weight-age, and the results are shown based on relevancy.
Now, I am planning to start with premium service, where I am thinking to list one supplier on top for each keywords in search results. Let say, S1 has been given premium search for keywords 'Jeans', so if a user searches 'jeans', I first wants to display this supplier on the top, then display other supplier based on relevancy. Plus, this premium service is for only for one month. So, another supplier say S2 can avail this service in next month and so on.
Is there any plugin, wherein I can store which supplier should be shown for which keyword. I am even OK with making 2 queries to meet the desire results.
Please suggest
I think the Query Elevation Component is your friend, you can configure which documents (and hence which suppliers) come first for any given query, see
https://wiki.apache.org/solr/QueryElevationComponent
If that's too much work, you could also add a new boolean field in your documents, indicating whether the document is to be promoted or not, and in the query, sort by this field first (so promoted documents come on top), and by score next (so most relevant documents come right after the promoted ones).
You can maybe also use the reRanking Componant :
https://cwiki.apache.org/confluence/display/solr/Query+Re-Ranking
With using a query like this :
q=jean&rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=3}&rqq=(brand:S1)
The top 1000 of results from query jean will be re-ranking thanks to the boost (of 3) add to the documents which contain the field brand with the value S1.
It can be useful, but in your case I think the QueryElevationComponent is the best.
Be careful, reRanking is only available since version 4.9.

Resources