NetSuite: Populate custom item field value on transaction custom column field - netsuite

I have 3 free-text custom fields on inventory item record. they contain different information based on location so my fields names are "XXXX Location1", "XXXX Location2" and "XXXX Location3". Across all transactions in the system we need to populate the information in a custom column field of these 3 fields based on the main location we choose on that transaction.
For example if on an Invoice the Main location is Location1 then our line custom column field should show information from "XXXX Location1" when user choose that item on the line; if Main location is Location2 on that Invoice then the line custom column field should show information from "XXXX Location2" when select that item on the line.
I understand this needs to be done thru scripts but i don't know how to write the script, could someone help?
Appreciate!!!

You don't need a script for that.
On the colmn field, set the field to be a formula.
In the formula, write the followin statement(change to real location names and real item custom field ids):
Case {location}
When "location1 name" then {item.custitem... }
When "location2 name" then {item.custitem.. }
When "location3 name" then {item.custitem...}
End

Related

Is there a way to create a saved search to find the buildable quantity of assembly items that are back-ordered

We need to establish what assembly items can be built to meet existing demand, i.e. the items on back order. The results should only list the assemblies + volume that can be built based on the component items being available.
To show the Buildable Quantity of all Assembly/Bill Of Materials items that are currently on back-order:
Create a Item Saved Search as follows:
Criteria (Standard) Tab
Type ANY OF Assembly/Bill Of Materials
Inventory Location ANY OF - None - and <Your Location>
Member Item Fields > Inventory Location ANY OF - None - and <Your Location>
Member Item Fields > Type ANY OF Assembly/Bill Of Materials and Inventory Item
Criteria (Summary) Tab
Line 1
Type: Minimum
Field: Formula (Numeric)
Formula: GREATEST(FLOOR(NVL({memberitem.locationquantityonhand},0)/{memberquantity}),0)
Greater than 0
Line 2
Type: Minimum
Field: Location Back Ordered
Greater than 0
Results Tab
Internal ID (Summary type Group)
Name (Summary type Group)
Description (Summary type Group)
Inventory Location (Summary type Group)
Location Back Ordered (Summary type Group)
Formula (Numeric) (Summary type Minimum): GREATEST(FLOOR(NVL({memberitem.locationquantityonhand},0)/{memberquantity}),0)
Formula (Text) (Summary type Group): 'Build | Open'
Example of results:
NOTES
IMPORTANT: You may want to change locationquantityonhand to locationquantityavailable in the formulas used in both the Criteria (Summary) and Results tabs.
Doing so will change the result to only show how many assemblies can be built without using items that are already committed to other customer orders.
Clicking the "Build" link in the search results takes you straight to the Build Assembly page with the item and stock location pre-selected.
If you require work orders for your builds you can change the URL generated in the Formula (Text) field in the Results columns.
Clicking the "Open" link in the search results takes you to the Item Record.
BONUS
If you'd like to be able to build the assembly without leaving the search results page you can add a column directly after the Formula (Numeric) column (the buildable quantity) as follows:
Formula (Text) (Summary type Group): '<a target="_blank" href="#" onclick=''try { itemid='||{internalid}||'; loc='||{inventorylocation.internalid}||'; qty=this.closest("td").previousElementSibling.textContent; qty=prompt("How many would you like to build?",qty); if(qty>0) { this.textContent = "PROCESSING"; rec=nlapiTransformRecord("assemblyitem",itemid,"assemblybuild",{"quantity":qty,"location":loc}); id=nlapiSubmitRecord(rec); this.textContent = "BUILT "+qty; this.removeAttribute("onclick"); this.href = "/app/accounting/transactions/build.nl?id="+id; } } catch(e) { alert("ERROR: "+e.getCode()+": "+e.getDetails()); this.textContent = "ERROR"; } return false;''>Immediate</a>'
This will create a link that says "Immediate" which, when clicked, will prompt the user to enter a quantity and will then create a build for that amount and record it in the search results so you can see which ones you've done (clicking the new "BUILT (qty)" text after a completed build will take you to the newly created Assembly Build record.)

RunningCount webi Business Objects Formula

I am trying to produce a running count of salesid's for each distinct customer id.
I have tried this formula:
=RunningCount([Order ID])ForAll([Query 1].[Brand Account ID])
And unfortunately it yields this result:
We can see that where 'Count_of_Salesorder' == 12, it should have reset to 1 because the customer id has changed from B000115545 to B000159009
How can I achieve the running count of 'Order ID' for each distinct customer id? (Customer id is the field containing values that begin with 'B000')
You need to specify that you want the count to reset for each value of Brand Account ID.
=RunningCount([Order ID]; ([Brand Account ID]))
If you navigate to the RunningCount function with the Variable Editor and click on the "More on this function" link you will see its documentation.

Showing Last Sold Date In a Netsuite ITEM Saved Search

I've created a search that shows current inventory on hand, their purchase price, and a formula that multiplies the two to have current value.
In the results field I want to have a column that shows the last time an item was on a sales order. but i am coming up short. Is there a way to do this?
Filter Criteria
Results Criteria
Criteria -
Inactive - FALS
Type - Inventory Item
Transaction Field: Type - Sales Order
Available - Is greater than 0
RESULTS -
Name - (Summary Type Group)
Description - (Summary Type Group)
Available - (Summary Type Count)
Transaction Fields - Date (Summary Type Maximum)
Did you create the saved search from the Item Record or Transaction Record?
If you created it from the Transaction Record then you will want to make sure to use the Date Field and Summary Type (Results tab) as Maximum.
Field = Date
Summary Type = Maximum
If you created the saved search from the Item Record you will need to use the Transaction Fields... table join to bring in the Transaction Date field.

Kentico - Form Control Drop-down List & SQL Query

I couldn't make the title clearer, but here's what I need help with.
I have a custom page type [1] for Leaders which includes 2 fields: Name, and Title. This holds the list of all leaders at the company.
I have another custom page type [2] for Speaking Events, which includes a field called Speaker to display the speaker's name and title. This field was set up as a drop-down list with data source from a SQL Query to query the Leaders data in [1].
Select LeadersID, Name, Title from co_leaders order by Name
I got it work fine - the drop-down displays a list of Name. However, what I wanted to display in the drop-down option is: Name, Title (not just Name) like below so that I only pick one and have both Name and Title. Is it possible to do this?
John Doe, CEO
Jane Doe, CFO
Hope it's clear and thanks for your input!
This is the SQL you are looking for:
SELECT LeadersID, Name + ', ' + Title FROM co_leaders ORDER BY Name
You need to do a concatenation of the column values (Name and Title), as opposed to selecting the columns separately.
EDIT: This is assuming that Name and Title are not nullable fields.
If there is a NULL value in any of the concatenated fields, the end value will be NULL. In this case, you will need to use COALESCE (or an equivalent function) to define an alternative value. For example:
SELECT LeadersID, Name + ', ' + COALESCE(Title, 'Member') FROM co_leaders ORDER BY Name

Complicated condition

I have predefined item combination (for example brand1|brand2|brand3 etc) in the table.
i like to collect brands and check against with predefined table data.
For example i collected brand1|brand2|brand3 then i can do get some value form that predefined table(it meets the condition).
How can i check?
brands would be unlimited. also brand1|brand2|brand3 of brand1|brand2| exist then returns true.
Okay, taking a wild guess at what you're asking, you have a delimited field with brands in them separated by a | character. You want to return any row that has the right combination of the brands in there, but don't want to return rows with, for example, brand "testify" in them when you search for "test".
You have four search conditions (looking for brand3):
the brand exists by itself: "brand3"
the brand starts the delimited field: "brand3|brand4|brand6"
the brand is in the middle of the field: "brand1|brand3|brand6"
the brand is at the end of the field: "brand1|brand2|brand3"
so, in SQL:
SELECT *
FROM MyTable
WHERE BrandField = 'brand3'
OR BrandField LIKE 'brand3|%'
OR BrandField LIKE '%|brand3|%'
OR BrandField LIKE '%|brand3'
Repeat as required for multiple brands.

Resources