Solved

Custom Field on Service Quotation

  • 2 November 2022
  • 7 replies
  • 78 views

Userlevel 4
Badge +11

I confess my Custom Field experience is limited so I am hoping someone can help.

I want a Custom Field on the Service Quotation Header that pulls the Total Cost from the Service Quotation Totals Tab.

 

When I do the Select Statement in Sql query it returns what I am expecting but in the Custom Field I get a bind error.

 

Can someone please advise what I have done wrong?

 

Select Statement:

Select total_cost from service_quotation_totals_uiv where quotation_no =: quotation_no

 

thanks, 

 

 

icon

Best answer by lisa.gilesAB 2 November 2022, 18:31

View original

7 replies

Userlevel 7
Badge +22

Hi @lisa.gilesAB 

your sql query looks good. I recommend you to use also the contract or company.

Maybe you can provide some screenshots to check it.

Userlevel 4
Badge +11

@Link  thanks for replying. Do you mean use the Contract or Company as an ‘and’ clause so quotation_no and contract = contract or something similar?

 

My Statement:

and this is the error i am receiving:

any help would be greatly appreciated :)

Userlevel 7
Badge +22

Hi @lisa.gilesAB 

exactly. To get only one data.

In this case choose the option “Select”. And then you need two parameters:

v.quotation_no, v.contract (or v.company)

 

My recommendation:

Select total_cost 

from ifsapp.service_quotation_totals_uiv 

where quotation_no = :quotation_no 

and contract = :contract 

(It is only an example)

You have to check whether you can use the parameter contract or company.

Userlevel 5
Badge +11

I think a slight correction is needed with the way you have written your binding.

Your example.

quotation_no =: quotation_no

Should be.

quotation_no = :quotation_no

 

Also if you look at the view service_quotation_totals_uiv, you may need a few other columns or perhaps sum the total cost because using just the quotation no may return more than one record.

Userlevel 4
Badge +11

@Link 

I now get this:

 

sorry, any ideas?

Userlevel 4
Badge +11

@Technical Outlaws Can you provide an example of what the sql would look like? 

 

Sorry, I am struggling with this one

Userlevel 4
Badge +11

I Fixed it :) I am not really sure what I did but it is working :) Thanks everyone! 

Reply