AX 2012 Database - BaseEnum to String - enums

I am trying to Code a "while select" Statement.
I have a table "CarBrandTable" with two fields:
CarBrandId and Countries.
CarBrandId is a String.
Countries is a Base Enum.
Now I want to get the Data, by asking with a select Statement.
When I want to retrieve the Data by saying info(carBrandTable.countries);
The Compiler says... "Argument 'txt' is incompatible with the required type"
I know that my baseenum is not a string and that I hvae to somehow convert it.
But I have Trouble in doing so.
Does anybody have a tip for me ?
Thanks in advance

Rephrase the info like this:
info(strFmt('%1', carBrandTable.countries));

Other way is enum2str function.
info(enum2str(carBrandTable.countries));

Related

Confirm my attempt at converting Crystal reports selection criteria to Oracle SQL

I have to create selection criteria for an Oracle SQL query based on a snippet from Crystal Reports.
I have no experience with Crystal reports so I have been trying to figure it out searching the web, but seem to be just wasting my time - Could not find anything helpful for this kind of task on the web.
This is the selection criteria that was provided:
{MATL_USED_VW.MAT_ID} = {?Material ID} and
{#Use Date} in {?Previous Use}
//#UseDate = Date({MATERIAL_ACTIVITIES.MA_END})
The column data types are all date columns except for the numeric MAT_ID column
I think this would equate to the following:
where matl_used_vw.mat_id = :Material_id
and use_date in (:previous_use, :usedate)
This is just a swag based on assumptions.
Here's my assumptions on the symbols:
? - probably is a parameter or prompt for input
# - has something to do with formulas
// - is continuation of previous line
{} - encloses an object (text, date number or whatever)
I'm not sure of anything here, it's all just a guess.
If anyone could shed some light on this, I would really appreciate it!
Thanks for the help on this!
Here's the answer in case some other schmuck unfamiliar with Crystal reports needs a similar answer:
# is a Formula. In this case, to convert text to date.
? is a Parameter In this case it represents a range
// is a remark. Same as # or ‘ in other languages.
{} - encloses an object (text, date number or whatever)

DMQL2 Query Syntax for PHRets v2 Seach() to include filter arguments?

(It's been a while since I've been here.)
I've been using the first version of PHRets v1 for years, and understood it well enough to get by, but now I'm trying to understand the advantages of v2.6.2. I've got it all installed and the basics are working fine. My issues are pretty much with comprehending fine points of query syntax that goes into the rets=>Search() statement. (I'm much more familiar with SQL statements). Specifically, I'd like to have a query return a list of properties, EXCLUDING those which already have the status of "Sold".
Here's where I am stuck: If I start with this
`$results = $rets->Search('Property', 'A','*',['Select' => 'LIST_8,LIST_105,LIST_15,LIST_19,listing_office_shortid']);`
That works well enough. BUT I'd like to fit in a filter like:
"LIST_15 != Sold", or "NOT LIST_15=Sold"...something like that. I don't get how to fit/type that into a PHRets Search().
I like PHRets but it is so hard to find well-organized/complete documentation about specific things like this. Thanks in advance.
As in my comment above I've figured out that the filter goes in the third argument position ('*', as in the original question). The tricky thing was having to find a specific "sold" code for each class of properties and placing it in that position like so: '(LIST_15=~B4ZIT1Y75TZ)', (notice the =~ combination of characters that means "does not equal" in this context). I've found the code strings for each of the property types (not clear WHY they would need to be unique for each type of property: "Sold" is Sold for any type, after all) but the correct code for a single-family residential property (type 'A' ...at least for the MLS in which I have to search is:
$results = $rets->Search('Property', 'A','(LIST_15=~B4ZIT1Y75TZ)',['Select' => 'LIST_8,LIST_105,LIST_15,LIST_19,listing_office_shortid']);
(again, the code to go with LIST_15 will be different for the different types of properties.) I think there is a better answer that involves more naturalistic language, but this works and I guess I will have to be satisfied with it for now. I hope this is of some use to anyone else struggling with this stuff.

Convert the total amount in words

I'm converting my total amount into words using bi publisher. Btw, the amount is base on the data from the data set. Can someone help me what to do? Thanks
<?xdofx:to_check_number,sum(COLUMN_NAME, ‘EUR’, ‘CASE_UPPER’, ‘DECIMAL_STYLE_WORDS’)?>
I expect the output to be in words but the actual ouput is blank.
Use the function xdoxslt:toCheckNumber
Like this:
<?xdoxslt:toCheckNumber($_XDOLOCALE, sum(COLUMN_NAME), ‘EUR’, ‘CASE_UPPER’, ‘DECIMAL_STYLE_WORDS’)?>
For a detailed explanation, check this page. But bear in mind, this is an undocumented function.
In E-Business Suite r12, the XML file from the "out of the box" payments module has amount in text: OutboundPaymentInstruction/OutboundPayment/PaymentAmountText
<?xdofx:to_check_number(sum(COLUMN_NAME), 'EUR', 'CASE_UPPER', 'DECIMAL_STYLE_WORDS')?>
should work with fixed quotes and converted part ,sum(COLUMN_NAME,... into(sum(COLUMN_NAME),....
You can try this one which is working for my case.
<?xdoxslt:toWordsAmt(2300)?>
CASE_INIT_CAP

Use condition in powerpivot (DAX)

My problem is that I can't get the IF condition to work in powerpivot (using DAX).
According to manual the syntax is:
IF(logical_test>,, value_if_false) where I can omitt the "value if false" if i want.
I have a lot of columns and I try to make a new one based on condition from another column.
What I tried is =IF([TimeTypeCode]="400", [WorkingHours]) and that doesn't work. What I want my condition to do is that if [TimeType] is equal to 400, then i want to put the value from [WorkingHours] in my new column. How can i do this?
from what I see here the problem is the ="400", the "" you used tell dax thats a string type and you are trying to use it as a numeric value.
Try using
IF([TimeTypeCode]=400, [WorkingHours])
instead,
Cheers!

IsEmpty or IsNull or IsNothing?

Can someone help me determine which I should be using?
Here is the situation - I am pulling a value from a column in the Data Table. If there is anything in that column, I set the data to a variable and take an action. If the column is blank, I want to skip that.
I am confused as to which IsWHATEVER statement would be best. For Example:
If IsEmpty(Datatable.Value("M4","Data_Entry"))=False Then
OR
If IsNull(Datatable.Value("M4","Data_Entry"))=False Then
OR
If IsNothing(Datatable.Value("M4","Data_Entry"))=False Then
Suggestions?
I've just tried all of your options and found this to be the most correct:
If (DataTable.Value("M4","Global") <> "") Then
Your original options will not work on QTP Datatables as these are for uninitialised objects or variables. However, in QTP as soon as you create a parameter in the Datatable the first value gets initialised as blank (not to be confused with empty).
I agree with shreyansp.. The 3 options are for variables and objects
You could also use the below expression
If len(trim(DataTable.Value("M4","Global"))>0 Then
'Do code here
End If

Resources