RSV-VAL-0034 Failed to validate the variable 01. CRX-API-0016 The expression input string is empty: """" IBM - cognos

I am using Version 11.1.2fp2 IBM Cognos. I have many simple case statements that do not validate. The Report Runs. The report produces the expected output of data.
The error is RSV-VAL-0034 Failed to validate the variable 01. CRX-API-0016 The expression input string is empty: """".
CASE
WHEN [Grant Agency TRACCD FRGBIL FOBTEXT with Budgets].[REAUTH_SDE_LAWS] IS MISSING
THEN ''
ELSE TRIM([Grant Agency TRACCD FRGBIL FOBTEXT with Budgets].[reauth_law_chapter])
END
Kindly, I have attached a screen shot with the Do you have any insights?

The CRX error family is usually linked to variable or report expressions, which means it's probably not tied to the data item case statement. Given the report runs it may also indicate the report expression is not actually used anywhere.
Please have a look at: https://www.ibm.com/support/pages/crx-api-0016-report-upgrade

The "Validate" button in the Data Item Expression dialog doesn't validate that expression. It validates the entire report. It is often misleading because the message displayed may have nothing to do with the expression you are looking at.
Here's what to do.
Close the Data Item Expression dialog.
Click on the More button in the top right (the 3 dots arranged vertically).
Select Validate report.
Select the first item in the Validation response.
Click Select.
If Cognos chooses to be nice to you, it will navigate to and highlight the offending object.

#dougp mentioned, an unprocessable variable from cognos is just what happened. Sometimes it might get hard to find the variable itself. One way of finding it is to get the xml definition and the search for the the declared variable.
Reimporting the report won’t overwrite until you choose the saving location.

The root cause is the variable "Boolean1" was never used by the report. The variable "Boolean1" was not tied to the data item in the case statement. I created the variable "Boolean1" and forgot about it. I did not use the variable "Boolean1" in the report. I found the variable "Boolean1" and removed it. Now my validation of the report expressions works fine. I value your insights.

Related

NetSuite Phone Number Formatting

I am trying to implement automatic phone number formatting into NetSuite I am having some issues getting my script to work. Basically if someone enters a phone number into a customer record, "1234567890" for example, it will automatically format to "(123) 456-7890". You can see my script below along with the error message I receive when creating a new script record.
Fail to evaluate script:
{"type":"error.SuiteScriptModuleLoaderError","name":"UNEXPECTED_ERROR","message":"missing ; before statement (SS_SCRIPT_FOR_METADATA#21)","stack":[]}
Why do you need a script for this? NetSuite already does this, based on the Phone Number Format setting at Setup > Company General Preferences. Check you have this field set correctly according to your preference.
If for whatever reason it turns out you do need a script for this, there are several issues with the script you posted:
There is a syntax error - mismatched parentheses/braces. Your code editor is trying to show you that with the red brace on line 8 and the red squiggly underline on the last parenthesis (line 23).
NetSuite record level client scripts must implement an entry point function. For formatting phone numbers this would be a fieldChanged() entry point. You would need to wrap the logic contained in lines 10 to 20 inside a function, and then reference that in the return statement at the bottom. EG: If you called the function phone() your return statement would be return {fieldChanged: phone}.
You are using SuiteScript 1.0 API functions (nlapiGetRecordId() and nlapiLoadRecord()) in a SuiteScript 2.0 script. Under some circumstances these functions may be available so it might work, but even if it does, it certainly isn't best practice.
Loading the record isn't necessary. When you implement an entry point function, the function is passed a context parameter. IE: function fieldChanged(context). That context parameter contains a reference to the current record (context.currentRecord). Work with that instead of attempting to load the record separately.

Lotus Notes: RichText Content

I want to create a field that will tell me,
if that field's content is empty (ex: no attachment),
it will reflect in another field that it is empty.
For that reason,
I have created/tested a Rich-Text field in a form.
Let's say that Rich-Text Name is Test1.
Then, I added a computed text field, let's say the name is Test2.
In Test2 field, I set the formula as this,
#If(Test1!="";"Yes";"No")
As a result, in the Test2's field, it does not show me that the Test1's field is empty, even though it has no text/attachment inside the Test1 field.
I have tested many times, and the result is still the same.
Please help me on this matter to solve this problem.
Thank you in advance.
There is no direct solution AFAIK. If using LotusScript is an option for you, here's a common workaround to find out whether an RT field is empty:
Put the focus on the RT field by calling NotesUiDocument.GoToField("Test1").
Select all contents of the RT field by calling NotesUiDocument.SelectAll().
The call to NotesUiDocument.SelectAll will raise an error (can't remember wich error code) if the RT field is empty. Trap that error using On Error GoTo <label of error handler>. If the code does not enter the error handler, you know the RT field is not empty. If it does, you know the RT field is empty. You can then take the appropriate action, e.g. put a message in text field 'Test2'.
To make this approach more user-friendly, I'd also suggest you add some code that puts the focus back on the original field (i.e., the field that had the focus before the above LS code was triggered).

"Query is not understandable (4000)" error on view refresh

I have the following two lines of code:
Set customerView = db.GetView ("(Lookup - Customers by Reference)")
Call customerView.refresh()
Very occasionally, the 2nd line will give users an Error 4000, Query is not understandable
Restarting Notes gets rid of it, but it sometimes comes back for a couple of users.
This has only recently started happening, and I've not made any changes to the view.
EDIT
To explain further, nowhere in the function that is throwing the error is there any code relating to a FT Search, which makes me think that this may be an error that IBM have stuffed up in R9.0.1
Check Forms and Fields (especialy fields!) you use in search formula of the view.
Maybe you search text value in non-text fields.
Fields are shared between forms, i.e field is unique not within form, field is unique within NSF. So, first time you create field - NSF writes it's properties (field type included) in NSF structure. And if you have two forms containing field with same name, but with different types (text and non-text) - you'll get this error.
I saw this error several times, and every time it was caused by FT-queries or search formulas what tries to search some text value in field, that initialy was created as non-text (date or numbers field).
If this is the case... Well, it's hard to get rid of this error. Basically you'll have to delete this field from every form and every document in nsf, then compact it using copy-style, then recreate field in right type and restore it's values in docs using right type - it helps usually.

Problem getting value from "Checkbox group value prompt"

I've value prompt with ui:checkbox group
parameter: p_IsLastMonth
Name: Prompt_IsLastMonth
ItemCount: 1; UseValue:Yes, DisplayValue: LastMonth?
and two Date Prompts.
Whenever the checkbox is checked, the UseValue 'Yes' is passed to the parameter 'p_IsLastMonth'. But whenever the checkbox is left as it is, it results in an error.
Element 'selectOptions' is not valid for content model: 'All(style,defaultSelections,conditionalStyles,conditionalRender,XMLAttributes)'
I also tried giving a default value. But the default value has to be in the collection. But i want only one checkbox to be displayed.
I tried with html checkbox. But i'm not able to send the value 'either yes or no' to the parameter through javascript because however the finish button overrides the value.
Any help?
There are 2 ways you can use Parameters:
Evaluate Parameter value
Evaluate expression against Parameter value.
Either way your Parameter has some value, and no value is a kind of value. And you need to cater for empty value in some way. Eg:
If (?Parameter? <>'') then ([Selection Criteria] = 'True') Else (1=1)
OR
([Selection Criteria] = ?Parameter?) OR ?Parameter? = ''
There other ways of using parameters too. You should choose one that better suits situation and coding practices you are following.
You can use optional checkbox or text item. In Cognos 10 I get "Deselect" option under checkbox group.
Unfortunately, I don't think you can accomplish what you want to do with only one checkbox. The only way you can leave a value prompt unselected and still submit the prompt page is to make it "optional", which means no value will be passed. An option is to use two check boxes and make them "required" so that either "yes" or "no" must be selected (but this can result in both being selected, which isn't good), or preferably use a radio list with two values and "yes" as the default. There may be a javascript answer to this, but I try to avoid that as much as possible since it sometimes leaves you open to version upgrade issues. Using a radio list is your easiest option.
Well here is something that will work. I've done advanced scorecarding and dashboarding for years with Cognos and Javascript will work:
Create a real cognos parameter that has both choices you need Yes/No with no being the default. Put them perhaps in a html table somewhere off the main real-estate of the report/param canvas. Once you have the param configed you can make the size as small as you want and then make the table/checkbox invisible by turning the visible property to no. Basically the users won't see these params. Don't do box-type = non or the parameter won't even get generated. You could also wait on hidding them until we get step 3 working(Make it easier to troubleshoot).
Then create a HTML parameter that the user will use to interact with in the style that you want the users to see, and use javascript onchange events to manipulate the real hidden parameter by finding it via DOM model. You can make finding it easier by perhaps surrounding the hidden params with an HTML tag that has a unique name/ID and referencing the child items from there.
Since your cognos parameter is invisible you may not even need to use a check box... you could simply use a hidden text box that has stores Yes/No. This will make your coding simplified on the javascript until you get used to it.
Also When programming with javascript on Cognos i find using alert to echo a object's innerhtml to screen while troubleshooting to be very handy.
* One other less impressive approach if i remember right as well..
1. Leave your original cognos style checkbox alone and create another cognos prompt that is always defaulted to "-NO-" and hidden on the canvas.
2. In the expressions used to evaluate the parameters the would evaulate the concatenation values of both params and you could take logical action based on those values. So if the concatted results were "-No-" then you know the original paramater was not selected and to use "No". etc... I believe there could be a nuance to getting this to evaluate correctly in the expression editors but i have got this owrking before as well. * So i your case if the concatted results first 3 characters = "Yes" the "Yes" otherwise no.

Enable/disable editing of a form field from code

I'm not a Notes programmer, however, for my sins, have been working on some Notes features for an in-house project recently. I need to enable/disable editing of a field depending on circumstances. It seems to me to be a fairly standard feature, I need, but I can't find any information on how to do this anywhere.
In form setup (and other field's onchange) code, something like the following:
if some requirement = true then
textField.enable = true
else
textField.enable = false
end if
I've seen other places where there's a workaround of conditionally hiding paragraphs based on some code, having 2 paragraphs with opposite hiding conditions, one with an editable field, the other with a computed field. However, I don't know enough about Notes to see how this is implemented (I can see it done on other forms, but there seem to be some 'magic' steps within Notes which I either can't see or don't get).
[EDIT]
The reply from Kerr seems to be what I'm looking for, but I still can't find out where the InputEnabled property is located. Should have said in the initial question, I'm using Notes 7.0.3.
In fairness, it doesn't matter what the circumstances are for when to enable/disable the field, it's just some boolean condition that is set, in my case only on form loading so I don't even have to worry about this changing dynamically while the form is displayed.
I've got a few issues with Notes, my largest bugbear being that it's so tied so tightly to the Designer UI, which is utter shite. I can do this sort of thing programmatically in most GUI languages (C#, Java, Delphi, even VB), but I need to open property boxes in Notes and set them correctly.
This would be OK as an optional method, but forcing you to go this way means you can only work as well as the IDE lets you in this case, and the IDE here seems to actively work against you. You can't open multiple functions/scripts, you can't swap from one script to another without going back to the menus on the left, you can't easily search the codebase for occurrences of variables/fields (and believe me, this is a major failing for me because either Notes or the internal codebase in my case seems to make a lot of use of global variables!), you can only work with fields through the property boxes that get displayed, you can't edit code in Designer while debugging through the main Notes client.
While the Java side of the coding is better than LotusScript, it's still fairly crappy (why can't you debug INTO Java code?? Why do you need to re-import JAR files for each Java class, does each class have a different CLASSPATH???). Possibly this was improved in Notes 8, I hear it's based on Eclipse. Does anyone know whether this is true or not?
It would help to hear more specifics about the 'circumstances', but the most common way to handle this is to use a hide when formula on the field you want to enable/disable.
Technically you are not enabling or disabling the field, just hiding it, but usually that works just as well.
Since there are few events to work with in Notes, developers commonly use the document refresh as the 'event' to cause the field to hide or show.
Let's assume you have two fields called TriggerField and Subject. Say also you want to disable the Subject based on a value in the TriggerField. The easiest way to do so is to set the TriggerField as a Dialog List type and check the "Refresh fields on keyword change" option. This means when the value of the dialog list changes, the entire document will get refreshed.
Then in your hide when formula for the Subject field, you specify your criteria for when to show or hide that field. Anytime field values change, followed by a refresh of the document (i.e. form), that hide when formula will be re-evaluated.
There are other ways, depending on your circumstances, to solve this problem. If you want to let the user refresh the form themselves, put a button on the form that calls the #Command([ViewRefreshFields]) command. You can add any other formulas to that button before the refresh command if you want to make other changes to the form at the same time.
Another option is to make a certain field display-only. Then create a button that runs LotusScript to allow users to change that display-only field. In the script you can propmt the user for a value, set the display-only field, and then call for a document refresh.
In ND7 and up if you want to just disable the field for input, write an appropriate formula in the InputEnabled section of the field you want to disable.
So I have two fields one called Trigger, a checkbox with the value "On" and another Subject that is a text field. When Trigger is checked I want the value Subject to be enabled.
I simply put the following formula in the Input Enabled element of the field Subject:
Trigger = "On"
I also want this to be recalculated whenever the value of Trigger changes so I select the "Refresh fields on keyword change" option on the Trigger field.
If you're stuck in an older version you need to to hide paragraphs appropriately.

Resources