Solved

Custom Field - Select statement with two variables

  • 13 January 2021
  • 9 replies
  • 1220 views

Badge +6

Hi,

 

I want to add a custom field to the Purchase Requisition Lines view, which is based on two criteria to make the search unique.

I've made a Read Only Custom Field with one of the key variables, but make it work for each line I need to add a second variable to my select statement. Problem is: I get an error when I want to finish creating the Custom Field.

This is the field I want to add to Purchase Requisition Lines:

Operation_Description

This is what I got so far. 

Settings

Select Statement:

SELECT Operation_Description FROM Shop_Order_Operation WHERE Order_No = :Demand_Order_No AND Outside_Op_Item = :Part_No

This is the Error that appears after clicking on ‘Finish’:

 

And these are the results when I only use the Shop Order number as criteria:

1) Description of the first line on de Shop Order 2) second criteria to make search unique

Does someone know what I am missing here?

icon

Best answer by servetsc 15 January 2021, 08:54

View original

This topic has been closed for comments

9 replies

Userlevel 2
Badge +5

Hi

 

I am not sure about this problem but;

Can You try expression with shop_order_operation_api.Get_Operation_Description function It needs 4 parameters and all is available on purchase  requisition line.

 

I hope it helps.

 

Regards

servet

 

Badge +6

Hi @servetsc,

 

Could you give me an example of that expression? I've never used that expression before, so I don't know what to do yet.

 

Kind regards,

Karin

Userlevel 7
Badge +18

Hi,

The problem is because the Part_No isn’t available on the Shop_Order_Operation view.

Regards

 

John

 

 

Badge +6

Hi @johnw66,

 

I don't agree with you on that statement.

The Part_No is available on the Shop_Order_Operation view in the column ‘Outside Op Item’. 

 

Userlevel 2
Badge +5

Hi Karin,

 

There is a function to get op description ;

ifsapp.shop_order_operation_api.Get_Operation_Description(order_no,release_no,sequence_no,operation_no)

You can define it to purch req line with these variables;

ifsapp.shop_order_operation_api.Get_Operation_Description(DEMAND_ORDER_NO,DEMAND_RELEASE,DEMAND_SEQUENCE_NO,DEMAND_OPERATION_NO)

 

Like This;

Regards

Servet

 

Userlevel 7
Badge +20

Hi,

 

I want to add a custom field to the Purchase Requisition Lines view, which is based on two criteria to make the search unique.

I've made a Read Only Custom Field with one of the key variables, but make it work for each line I need to add a second variable to my select statement. Problem is: I get an error when I want to finish creating the Custom Field.

This is the field I want to add to Purchase Requisition Lines:

Operation_Description

This is what I got so far. 

Settings

Select Statement:

SELECT Operation_Description FROM Shop_Order_Operation WHERE Order_No = :Demand_Order_No AND Outside_Op_Item = :Part_No

This is the Error that appears after clicking on ‘Finish’:

 

And these are the results when I only use the Shop Order number as criteria:

1) Description of the first line on de Shop Order 2) second criteria to make search unique

Does someone know what I am missing here?

 

Hi @servetsc,

 

Purchase Requisition Lines is connected to view PURCHASE_REQ_LINE_ALL which is not the base view for this LU PurchaseReqLine

When you declare an argument as v.XXX, it searches in the base view, in this case PURCHASE_REQ_LINE

It seems like PART_NO is not included in the base view PURCHASE_REQ_LINE which the error is about.

You can get the part no using purchase_req_line_part_api.get_part_no(requisition_no_ => :requisition_no_, line_no_ => :line_no_, release_no_ => :release_no_) 

you can find variables to call the function from the base view.

 

Hope it helps!

Damith

 

 

 

Userlevel 2
Badge +5

Hi @dsj 

I can guess the problem with the query is about the base view of purch req line. Thank you for the information.

Servet

Badge +6

Hi @servetsc,

 

Thank you for your example, I tried it and it works perfectly!

 

Regards,

Karin

Userlevel 3
Badge +7

you need to delete the space between ‘= : ’

 

SELECT Operation_Description FROM Shop_Order_Operation WHERE Order_No =:Demand_Order_No AND Outside_Op_Item =:Part_No