I have an object Account that is mapped to Account_Table in the database. Can you please show me how I can get a collection of Account objects from the database given "where Account.NAME like 'Acc%' "
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
dim rc as new CRetrieveCriteria
dim acc as new Account
rc.ClassMap = acc.getClassMap()
rc.WhereCondition.addSelectLike("NAME","Acc%")
dim cc as CCursor = rc.perform()
while not cc.EOF
acc = new Account
cc.loadObject(acc)
debug.writeline(acc.NAME)
cc.NextCursor()
end while
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But how can I use this criteria without code? Because I'm using in a form and when I click at the button "Search" the code instances a Object and pass to the method find with the character %.
Thanks,
Andr Ribeiro
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have an object Account that is mapped to Account_Table in the database. Can you please show me how I can get a collection of Account objects from the database given "where Account.NAME like 'Acc%' "
The following should work
dim rc as new CRetrieveCriteria
dim acc as new Account
rc.ClassMap = acc.getClassMap()
rc.WhereCondition.addSelectLike("NAME","Acc%")
dim cc as CCursor = rc.perform()
while not cc.EOF
acc = new Account
cc.loadObject(acc)
debug.writeline(acc.NAME)
cc.NextCursor()
end while
But how can I use this criteria without code? Because I'm using in a form and when I click at the button "Search" the code instances a Object and pass to the method find with the character %.
Thanks,
Andr Ribeiro
Add a method to your object that wraps this functionality, and allows you to pass the search value as a parameter.
You may want to make it a static/shared method so that you don't have to instantiate the object first.