Forum Discussion
PhilB
4 years agoNew Contributor III
New Syntax for LookupRowFieldValue()
Summary
Is there any documentation and/or sample code showing how to use the new "dbWheres" argument in a LookupRowFieldValue() function?
Detail
In version 6.8 (maybe earlier), if you use .Look...
Sai_Maganti
4 years agoContributor II
Phil
Check this post
- PhilB4 years agoNew Contributor III
Hi Sai,
Thanks for the response. I did look at Joe's post, but I think I missed the screen-shot with the example code. I'll try that and see how it works. Thanks again.
- ckattookaran4 years agoValued Contributor
Here is something you can try.
Dim objDBWheres As New List(Of DbWhere) Dim objDBWhere As New DbWhere("RegisterID",DbOperator.IsEqualTo,"E000204") objDBWheres.Add(objDBWhere) Dim objScnWhere As New DbWhere("WFScenarioName",DbOperator.IsEqualTo,"BudgetV1") objDBWheres.Add(objScnWhere) Dim strFirstName As String = BRApi.Database.LookupRowFieldValue(si, "App", "XFW_PLP_Register", objDBWheres, "FirstName","")So this will create a WHERE similar to RegisterID='E000204' AND WFScenarioName='BudgetV1' (code does RegisterID=@RegisterID AND WFScenarioName=@WFScenarioName)
You can use AppendWithORVersusAND to change the default of AND to an OR. I don't think anyone will be using an alternate parameter name. So you can create the object then use a set for ORVersusAnd rather than mentioning the parenthesis and alternate name.
- AndreaF3 years agoContributor III
Thank you for providing the code sample, very useful! I've used it to update some LookupRowFieldValue functions from using the criteriaExpression to the dbWhere object and I can confirm the code provided works well!
Related Content
- 4 years ago
- 1 year ago