Hi There,
I need to select the table record on the basis of field name.
Below is the code i am using to get table fields
static void BEDictTable(Args _args)
{
mytablecustom lines;
str fieldName;
int day;
DictTable dt;
FieldId fieldId;
DictField dictField;
dt = new SysDictTable(tableNum(mytablecustom));
fieldId= dt.fieldNext(0);
while(fieldId)
{
dictField =dt.fieldObject(fieldId);
day = dayOfMth(today());
fieldName = "Day"+int2str(day);
if(dictField.name() == fieldName) // this is my custom field name
{
select lines where lines.worker == "XXXXXX" and lines. // how can i write one more condition for fetch the record from that column
}
fieldId= dt.fieldNext(fieldId);
}
}
In the select query i need to write one more condition on fieldName.
Can you please guide me how can i achieve my above requirement.
Thanks
*This post is locked for comments
Hi Nikoloas,
Thanks for your suggestion , it worked.
You don't need to pass the field name. Remember that qbds.addRange wants a field id as a parameter.
So just use qbds.addRange(dictField.id()).value("5555");
I tried to do it by QDBS as you suggeseted.
but in this line i am getting error,
qbds.addRange(fieldNum(Mytable, dictField.name()));///.value("5555");
how can i pass the field name?
thanks
Hi Nikolaos Mäenpää,
Thanks for your reply
can you please show any example.
Thanks
It should be easy if you use a Query object instead of a select statement.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156