Skip to main content
Question

It is possible to display difference result between two CF


Forum|alt.badge.img+9
  • Sidekick (Customer)
  • 142 replies

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

14 replies

Forum|alt.badge.img+10
  • Hero (Customer)
  • 84 replies
  • October 18, 2024

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). 


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

One is read only and one is persistent field.


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

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


Forum|alt.badge.img+10
  • Hero (Customer)
  • 118 replies
  • October 21, 2024

@Ed22 

Arguments : v.CF$_NPRISPEVOK_K_ZISKU, v.CF$_AAA_CISLO

Statement :

SELECT :CF$_NPRISPEVOK_K_ZISKU - :CF$_AAA_CISLO

from dual


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

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”


Forum|alt.badge.img+10
  • Hero (Customer)
  • 118 replies
  • October 21, 2024

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


Forum|alt.badge.img+10
  • Hero (Customer)
  • 118 replies
  • October 21, 2024

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


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

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” 


Forum|alt.badge.img+10
  • Hero (Customer)
  • 118 replies
  • October 21, 2024

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


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

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


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 21, 2024

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


Forum|alt.badge.img+10
  • Hero (Customer)
  • 118 replies
  • October 21, 2024

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


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 29, 2024

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. 

 


Forum|alt.badge.img+9
  • Author
  • Sidekick (Customer)
  • 142 replies
  • October 29, 2024

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings