How to set up prefixes on saved search for multiple choices in netsuite? - netsuite

I have a multiple select field that allows multiple selections of colors. I created a formula that would append a prefix of "color-" to each selected list, but it only appends it to the the beginning of the field. I'm not sure how I can split the field results up for the formula to where I can get it showing up for all results.
CASE WHEN {custitemtag_color1} is NULL
THEN ''
ELSE 'color-'||{custitemtag_color1}
END
Results with multiple selections show: color-Black,Lime Green,White
Expected Results need to show: color-Black,color-Lime Green,color-White

What's happening is that NetSuite returns "Black,Lime Green,White" as a single result for the multi-selection, then you're prepending "color-" to that text returned. To work around it within your saved search, you could simply replace any instances of the comma (",") with ",color-":
CASE WHEN {custitemtag_color1} is NULL THEN '' ELSE 'color-'|| REPLACE({custitemtag_color1}, ',', ',color-') END

Related

#Error when exporting to .csv from ssrs when trying to replace a comma with another field

I am trying to replace a comma with another field so you can import the data using a csv. I can do that successfuly by adding .ToString().Replace(","," And ") to the end of the field
EX. Fields!Fieldname.Value.ToString().Replace(","," And ")). This will replace the comma with the word And.
The issue I have encounterd is when the field is blank. It then exports a #Error in the cell. I have tried hiding the cell if it is blank but that works for everything but when it exports to a .csv.
If I cannot get the field to be just blank I would like to have it display 99.
Please help.
I have tried this as well...
=Iif(isNothing(Fields!FieldName.Value),"99",(Fields!FieldName.Value.ToString().Replace(","," And ")))
It still displayed an error
The problem is that you are trying to convert NULL (Nothing) to a string. Both sides of IIF are evaluated so even though you will never see the result, false part is failing when FieldName is null.
TO get round this, we first check if the field is null, then replace that with and emptry string "" and then do the ToString() bit.
try the following...
=IIF(
isNothing(Fields!TestField.Value),
"",
(IIF(IsNothing(Fields!TestField.Value),
"",
Fields!TestField.Value
).ToString().Replace(","," And "))
)

OR Formula in Word document not returning a value

I am working on a document where I need to be able to test multiple options in an if statement to see if one of them are true to decide if a paragraph displays on the document. I have been trying to figure out why my OR formula is not returning a value for me to test and I am not sure why it is not showing anything when it is updating.
I have inserted a field and added a formula within that field that I am hoping will work with my If statement to show the proper paragraph contens.
When I use an Or statement, even one as simple as { OR(1=1) } and update and toggle the field I get no result. From what I have read I should get a 1 or a 0, but I don't seem to get either of these results. The line just ends up blank. When I test it with my If formula it always shows the false result, even when the Or contains a true result.
The formula I am currently working with is:
{ IF{ OR("$event.eventType.name}" = "Birthday", "$event.eventType.name}" =
"Conference" } "Yes" "No" }
If I update and toggle the Or field it shows blank, no result either true or false, and makes the If formula show as false event on results where it should show true. As I mentioned above I even tried setting it to 1=1 and still could not get it to show as true. Not sure if there is something I am missing in working with the formula.
Any suggestions would be appreciated.
It's not clear from your post what $event.eventType.name is. Presumably it's a field generated by an Addin. In that case, you should be able to use something like:
{IF{={IF{$event.eventType.name}= "Birthday" 1 0}+{IF{$event.eventType.name}= "Conference" 1 0}# 0}> 0 "Yes" "No"}
or:
{={IF{$event.eventType.name}= "Birthday" 1 0}+{IF{$event.eventType.name}= "Conference" 1 0} \# "'Yes',,'No'"}
Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required. If your fields are a kind of mergefield, you'll need to insert 'MERGEFIELD ' at the start of each one, thus:
{MERGEFIELD $event.eventType.name}

fetch html data from website into excel vba

Object does not support this property or method.
Error occur on this line:
For Each ele In objIE.document.getElementsByClassName("table info-table").getElementsByTagName("tr")
getElementsByClassName() returns a collection of matching elements (even if there's only one match), so you need something like (e.g.):
For Each ele In objIE.document.getElementsByClassName( _
"table info-table")(0).getElementsByTagName("tr")
which will loop over the tr elements in the first table with a matching class name.
If you need a different table you'll need to adjust the (0)

Cognos query calculation - how to obtain a null/blank value?

I have a query calculation that should throw me either a value (if conditions are met) or a blank/null value.
The code is in the following form:
if([attribute] > 3)
then ('value')
else ('')
At the moment the only way I could find to obtain the result is the use of '' (i.e. an empty character string), but this a value as well, so when I subsequently count the number of distinct values in another query I struggle to get the correct number (the empty string should be removed from the count, if found).
I can get the result with the following code:
if (attribute='') in ([first_query].[attribute]))
then (count(distinct(attribute)-1)
else (count(distinct(attribute))
How to avoid the double calculation in all later queries involving the count of attribute?
I use this Cognos function:
nullif(1, 1)
I found out that this can be managed using the case when function:
case
when ([attribute] > 3)
then ('value')
end
The difference is that case when doesn't need to have all the possible options for Handling data, and if it founds a case that is not in the list it just returns a blank cell.
Perfect for what I needed (and not as well documented on the web as the opposite case, i.e. dealing with null cases that should be zero).

Datatables, match portion of text

I followed the example on DataTables website, but I can't get my filtering field to find what I want.
Let's say I have these strings:
This is a text
This is another text
Text here
Both global and column search, when searching for "text" (case-insensitive), return string 3 only. Why?
This is my code for the search function, almost the same as the examples:
$('#datatable').DataTable()
.columns( colX )
.search( $(this).val(), false, true )
.draw();
I did not implement the search function for global search, so I think it is using the built-in one, I just made the column search.

Resources