Solved

Custom Field Question

  • 1 March 2022
  • 2 replies
  • 617 views

Userlevel 2
Badge +6

Gosh, I know I’m like the 5th person to ask something similar to this but I was hoping for an IFS guru to help me out there.

I’m developing a custom field with a case clause but am getting the error

“Error in validation of Custom Attribute. The column line_item_no referred to in table t is not an approved persistent Custom Attribute.”

I feel like I’m 95% of the way there with this logic. Can anyone help me get the last 5%?

Arguments: v.order_no,v.line_no,v.rel_no,v.line_item_no

SELECT CASE
WHEN (real_ship_date-promised_delivery_date+4) > 0
THEN 'LATE'
WHEN (real_ship_date-promised_delivery_date+4) <= 0
THEN 'ON TIME'
ELSE 'ON TIME'
END CASE

FROM customer_order_line
WHERE order_no= :order_no
AND line_no = :line_no
AND rel_no = :rel_no
AND line_item_no = :line_item_no

icon

Best answer by william.klotz 1 March 2022, 00:54

View original

This topic has been closed for comments

2 replies

Userlevel 7
Badge +21

Hi @matthunter ,

 

We are using IFS Applications 10 Update 8 at the moment so that is what I used to test out your code. 

 

Your code looks good to me I was able to successfully create a custom read only field named DELIVERY_SCORECARD and I used your SQL statement in the custom field.  I created the custom field on the customer order line.

 

Here’s the SQL Code I used.

SELECT CASE WHEN (real_ship_date-promised_delivery_date+4) > 0 THEN 'LATE' WHEN (real_ship_date-promised_delivery_date+4) <= 0 THEN 'ON TIME' ELSE 'ON TIME' END CASE FROM customer_order_line WHERE order_no=:order_no AND line_no = :line_no AND rel_no = :rel_no AND line_item_no = :line_item_no

 

 

Here’s the main body of the custom field.

 

Regards,

William Klotz

Userlevel 2
Badge +6

Thank you William!

Looks like it is an issue with the updates to IFS then. I’m working with IFS9. I did a sneaky workaround and can use the CASE logic directly in Data Source Designer for Lobby. That’s where I was headed next anyway.

Really appreciate the help. To anyone who is reading this with similar issues, if your ultimate task is to create metrics and were planning on using Lobby, go straight there.