Question

How to Create BAQ Column with one static number

  • 2 September 2021
  • 9 replies
  • 503 views

How can I created a calculated field in a BAQ with one static number or word?  

 

This is a supplier ID provided from a customer.

 

 


9 replies

Userlevel 3

Why would you want to do that, since such a field, Customer.OurSupplierCode, exists in the Customer table?

This is not our supplier code that exists in Epicor.  This is the code that our customer has in their system for us.  Yes I could create a UD field and populate this number but I’m sure there is a way to have a static number in a BAQ as it will be exporting on a schedule and sending to this customer. 

Do you want your customer to put in the code as a parameter, or do you want it hard-coded into the BAQ?

Here is an example of creating the parameter, then placing the parameter in your calculated constant field.

 

No I need it hard coded

No I need it hard coded

Then you were on the right track with the example you shared at the start of this post. Enter your constant in the Editor box. Here is an example using the nvarchar data type:

 

Mine is similar but I am getting a syntax error.

 

 

In the Editor box you are enclosing your value in single quotes. Character data types are enclosed in single quotes. Integer and Numeric data types are not.

 

Actually, all of my calculated fields were failing.  This BAQ has several sub queries.  I recreate the BAQ and constant calculated fields and the syntax is good.  Thanks for your help.

Reply