Evaluate & @dblookup

Hi,

I’ve a LS problem.

I’ve a code that search data from a view. If I use a @dbColumn Evaluate code it works fine, if I use a @dblookup Evaluate code, it returns a “Variant does not contain a conteiner”.

This is the @dbcolumn code solution:


Dim obj_s								As New NotesSession

Dim obj_ws								As New NotesUIWorkspace

Dim obj_uidoc							As NotesUIDocument

Dim obj_list								As Variant



Dim v_list								As String

Dim v_question							As String

Dim v_view								As String

	

Set obj_uidoc							= obj_ws.CurrentDocument



v_question								= "Prompt message:"

v_view									= "NCfasi"	



obj_list									= Evaluate({@DbColumn("":""; "":""; "} & v_view & {" ; 2)})



v_list										= obj_ws.Prompt(PROMPT_OKCANCELLIST,"system", v_question, obj_list(0), obj_list)

and it works fine.

This is the @dblookup solution:


Dim obj_s								As New NotesSession

Dim obj_ws								As New NotesUIWorkspace

Dim obj_uidoc							As NotesUIDocument

Dim obj_list								As Variant



Dim v_list								As String

Dim v_question							As String

Dim v_view								As String

Dim v_field								As String



Set obj_uidoc							= obj_ws.CurrentDocument



v_question								= "Prompt Message:"

v_view									= "NCfasi"	

v_field									= obj_uidoc.FieldGetText("nc_txtRilProces")

obj_list									= Evaluate({@DbLookup("":""; "":""; "} & v_view & {" ; "} & v_field & {";2)})



v_list										= obj_ws.Prompt(PROMPT_OKCANCELLIST,c_testatasistema, v_question, obj_list(0), obj_list)



Call lfn_SetField(v_list, obj_uidoc)

This don’t work and returns the error.

Whe i try to debug code, the obj_list leaves empty.

Some one can help me please?

Subject: Evaluate & @dblookup

Wow. Your code is very difficult to read with all of that white space – it’s hard to follow the lines across the tab gap.

Don’t use “”:“” for the database; use “” instead. Same goes for the protocol:cache part – “” will do. The difference, though, is that it’s optional in the first argument, “” means something different from “”:“” in the database argument. “” by itself means “use the current database”, while “”:“” means use the current database file path, but on the local machine.

Subject: RE: Evaluate & @dblookup

excuse me for the message’s format but my intention was to explane due solutions to undestand the problem.

I tried to remove “”:“” with “” but without any results.

Moreover I have a similar code in other Sub and it works fine.

I not understand why, if i use @dbcolumn code the variant results full and if i use @dblookup the variant leaves empty.

The view is the same.

Another idea ?

Subject: RE: Evaluate & @dblookup

Are you certain that the value you are looking up actually exists in the view?

Subject: SOLVED: Evaluate & @dblookup

Sorry, sorry & sorry.

In the child field the value contained a “d” to much. :slight_smile:

Sorry again !!!

A virtual coffee payed for you :wink:

Thank you very much

Subject: RE: Evaluate & @dblookup

this is the complpete code that i need to run:

Dim obj_s As New NotesSession

Dim obj_ws As New NotesUIWorkspace

Dim obj_uidoc As NotesUIDocument

Dim a_listOptions As Variant

Dim a_listValue As Variant

Dim v_list As String

Dim v_value As String

Dim v_question As String

Dim v_view As String

Dim v_view1 As String

Set obj_uidoc = obj_ws.CurrentDocument

v_question = “Prompt Message:”

v_view = “NCprocessi”

v_view1 = “NCFasi”

a_listOptions = Evaluate(|@DbColumn(“”;“”;“| & v_view & |” ;1)|)

v_list = obj_ws.Prompt(PROMPT_OKCANCELLIST,c_testatasistema, v_question, a_listOptions(0), a_listOptions)

a_listValue = Evaluate(|@dblookup(“”;“”;“| & v_view1 & |”;“| & v_list & |”;2)|)

v_value = obj_ws.Prompt(PROMPT_OKCANCELLIST,c_testatasistema, v_question, a_listValue(0), a_listValue)

when i debug the code, and the code step the calculation of a_listValue, it return “Variant does not contains a container”.

Subject: Evaluate & @dblookup

Try to remove the colons and see if that helps

Thomas

http://www.notessidan.se/A55B53/blogg.nsf/plink/PPAN-6MEVDZ