i created new column in RetailStoreTable type Enum (acceptnegativevalue) and type of this enum is (NoYes) as you see here in Retail stores
now i want check this value when i press post statement in open statement form
so i edit main code of post statement for check if total Difference is negative or positive to this code
void clicked() { if(Sale_M_totalDifferenceStore.realValue()>=0) { super(); statementLine_ds.executeQuery(); element.close(); } else { info ("in this case can't accept negative value you must change case"); } }
so i need to check (acceptnegativevalue) first befor start my previous code
how can i add this into my code?
*This post is locked for comments
If you put your current store value to where statement - yes.
RetailStoreTable retailStoreTable;
select retailStoreTable
where retailStoreTable.StoreNumber == yourStoreId;
if (retailStoreTable.acceptnegativevalue == NoYes::No)
so is that query will get the current store ?!
No. Next you need to get the record of retailStoreTable.
RetailStoreTable retailStoreTable;
select retailStoreTable
where ...
if (retailStoreTable.acceptnegativevalue == NoYes::No)
thanks for replay but i got this error
(Variable RetailStoreTable has not been declared.)
so i edited it to this
void clicked() { RetailStoreTable retailStoreTable; if (retailStoreTable.acceptnegativevalue == NoYes::No) { if(Sale_M_totalDifferenceStore.realValue()>=0) { super(); statementLine_ds.executeQuery(); element.close(); } else { info ("in this case can't accept negative value you must change case"); } } else { super(); statementLine_ds.executeQuery(); element.close(); } }
and error gone is that ok?!
Hi!
If you already have the record of RetailStoreTable just add this:
if (RetailStoreTable.acceptnegativevalue == NoYes::Yes) - depends of that you need to check
if you haven't record of RetailStoreTable, you should select the record first of all and then check the value.
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156