Solved

Using Quick Report Parameters and Flags - Different Parameters of the Same Type

  • 7 December 2021
  • 5 replies
  • 758 views

Userlevel 5
Badge +11

Hello Dear Community Users,

 

I have a question regarding the following topic.

I need to add the current operation state and the state of the operation before the current operation as parameters. When the parameter popup window is opened, 2 pieces of operation status (Oper Status Code) field are displayed. Which one is present and which previous operation parameter is not understood. 

SELECT *
FROM shop_order_operation o
LEFT JOIN shop_order_operation prev_op
ON prev_op.order_no = o.order_no AND
prev_op.release_no = o.release_no AND
prev_op.sequence_no = o.sequence_no AND
prev_op.operation_no = shop_order_operation_api.get_previous_operation(o.order_no, o.release_no, o.sequence_no, o.operation_no)
WHERE
o.work_center_no = '&[MCS-L]Work_Center_No' AND
o.oper_status_code = '&[MCS-L]shop_order_operation.oper_status_code' AND
prev_op.oper_status_code = '&[MCS-L]operation_history.oper_status_code';

How do we make special prompt when we use view column which is enumeration?

 

Best Regards,

Barış

icon

Best answer by Jonas Feigl 7 December 2021, 22:48

View original

This topic has been closed for comments

5 replies

Userlevel 7
Badge +15

Hi,

This is not possible. The scanner for to prompts in the SQL treats each parameter individually even if the same is the same.

Regards,

Chanaka

Userlevel 7
Badge +20

Hi @baris.halici and @ChanakaAmarasekara 

 

I think it can be done using a small trick with custom fields ;)

 

here’s what I did in a Apps 10 environment but hope this will work in Apps9 also

 

Create a local custom field in OperationHistory and name the prompt as Previous Oper Status code

 

 

You may define translations if you need

refresh server caches

In the use the custom field as second status parameter. Hope it will does the work!

prev_op.oper_status_code = '&[MCS-L]operation_history_cfv.cf$_oper_status_code'

 

Cheers!

Damith

Userlevel 5
Badge +17

@baris.halici I haven't tried this but I think you could use a somewhat weird workaround:

Create a Custom LU with a single persistent attribute that uses the 'OperStatusCode' enumeration. Define the field's prompt with the label you want in the quick report and publish the Custom LU. In your quick report you should then be able to reference the custom attribute in the Custom LUs CLV-view (e.g. "dummy_lu_clv.cf$_oper_status_code" instead of "operation_history.oper_status_code".).

As mentioned I haven't tried this but I think this should work.

Userlevel 7
Badge +20

I hope what @Jonas Feigl suggests should work but I’m thinking of a different way.

 

Create a new Local custom field on Operation History for OPER_STATUS_CODE and name the Prompt as Previous Oper Status Code.

 

Change the reference in sql to use the CFV

 prev_op.oper_status_code = '&[MCS-L]operation_history_cfv.cf$_oper_status_code'

 

 

Hope it helps!

Damith

Userlevel 5
Badge +11

I actually asked if there is a clause that can be used directly within the parameter. As Mr @ChanakaAmarasekara  said, I think there is no such thing. 
@Jonas Feigl  and @dsj I think it's similar in both answers and it's a solution that will actually work.​ Thank you very much for the answers my friends.

 

Regards,

Barış