It is possible to display difference result between two CF
Hello,
It is possible to retrieve in extra column in IFS cloud the difference in values between two CFs? I have two Custom Fields, for example CF_12 and CF_11 and I want to display (CF_12 - CF_11) in extra column, how can I achieve it? Should I use in creating new column in this entity Custom Field - Select statement, Expression or Reference Value? Only CF_12 is located in SQL, CF_11 is not
Page 1 / 1
Hi @Ed22, This is possible. How this should be achieved depends a little if the CF's are read only or persistent fields.
What you could do is create a NEW custom attribute which has an expression like (v.CF$_12 - v.CF$_11).
One is read only and one is persistent field.
So, if I have attribute name1: “CF_NPRISPEVOK_K_ZISKU” and attribute name2: “CF_AAA_CISLO”, I should create Read Only Field, which will have Expression Statement: “v.CF$_NPRISPEVOK_K_ZISKU - v.CF$_AAA_CISLO”? Because this is not working
it says that “The column CF$_NPRISPEVOK_K_ZISKU refered to in table t is not an approved persistent Custom Attribute. CF$_NPRISPEVOK_K_ZISKU”
you can’t call any CF from the standard IFS table, but the view.
That’s why it’s important to make the difference in between t for Table and v for View when you list your arguments
Question : only consider the v.OBJKEY as argument
and do something like
SELECT CF$_NPRISPEVOK_K_ZISKU - CF$_AAA_CISLO
from your_ifs_view
where OBJKEY = :OBJKEY
CF$_AAA_CISLO belongs to SALES_PRICE_LIST_PART_PRICE view, but CF$_NPRISPEVOK_K_ZISKU is persistent field and dont belong to any view.
This is my SQL statement:
“SELECT CF$_NPRISPEVOK_K_ZISKU - CF$_AAA_CISLO from SALES_PRICE_LIST_PART_PRICE where OBJKEY = :OBJKEY”
Arguments: “v.OBJKEY”
it says: “There might be a problem with the select statement. No further validation can be made for a Read Only Select Field before publishing”
but CF$_NPRISPEVOK_K_ZISKU is persistent field and dont belong to any view
I don’t understand what you mean, a custom field must be attached to a view and must be published AND approved to be called in your case, so CF$_NPRISPEVOK_K_ZISKU
I am not sure about this task, but I think that in CF$_NPRISPEVOK_K_ZISKU they are inputing values manually, and CF$_AAA_CISLO is located in SQL view SALES_PRICE_LIST_PART_PRICE
for example, in view is default value for column CF$_AAA_CISLO = 64,11and they manually input value for persistent field in CF$_NPRISPEVOK_K_ZISKU = 68,76 and I want the difference
Just noticed an error in your sql querry :
“SELECT CF$_NPRISPEVOK_K_ZISKU - CF$_AAA_CISLO from SALES_PRICE_LIST_PART_PRICE where OBJKEY = :OBJKEY”
the SALES_PRICE_LIST_PART_PRICE view can’t reach any CF, but SALES_PRICE_LIST_PART_PRICE_CFV
one is read only and is located in SQL and second one is persistent field which is not located in any SQL. I tried to make difference: This is inputed in expression (CF$_NPRISPEVOK_K_ZISKU - CF$_AAA_CISLO) but in final tab it returns nothing.
I know how to make difference between two columns which are located in SQL, but I am not sure if it is possible if one is readonly and other one persistent field.