Question

How to format attribute/UDF to use in GI calculated field?


Userlevel 3
Badge

We are using attributes/UDFs to track the Install points on a service order - this is a measure of how difficult/time consuming the install will be based on a number of factors. The higher the number the higher the difficulty. This figure is also used to calculate install fees paid out to our installers.

 

I’m trying to use this UDF in a GI to display the install fee (install points x install rate), but receiving the following error:

 

Am I able to use this field to generate a calculation? Do I need to modify the mask on the attribute? Do I need to throw a formatting formula before the attribute field on the Results Grid?


15 replies

Userlevel 7
Badge +11

Hi @jwarren 

Can you share the setup of the Attribute?

Userlevel 3
Badge

 

Userlevel 3
Badge

Any thoughts @

Hi @jwarren 

Can you share the setup of the Attribute?

Any thoughts?

Userlevel 7
Badge +15

Hi @jwarren  Can you please share the GI here?

Userlevel 3
Badge

Hi @jwarren  Can you please share the GI here?

Hi Naveen,


Here is a snippet of the Results Grid:

The last row is a simplified version of the calculation we are looking to do.

Userlevel 7
Badge +8

@jwarren Your control type is Text but you are trying to perform an arithmetic operation on it. If the user meant to enter numeric values, why did you declare it as text?

you can try CInt(IIf(Trim(YourField)=’’,0, Trim(YourField)))*100 but considering the field may contain stored string values, you still may get an error.

You will need to change the field to a numeric type to make it properly work and set a default 0 for it.

Userlevel 3
Badge

@jwarren Your control type is Text but you are trying to perform an arithmetic operation on it. If the user meant to enter numeric values, why did you declare it as text?

you can try CInt(IIf(Trim(YourField)=’’,0, Trim(YourField)))*100 but considering the field may contain stored string values, you still may get an error.

You will need to change the field to a numeric type to make it properly work and set a default 0 for it.

Thanks - I’ll try that formula but ideally the UDF would just be set up as a numeric type.

 

Is there a numeric type? The options I have are Text, Combo, Multi Select Combo, Checkbox, DateTime, and Selector.

Userlevel 7
Badge +8

Considering you have a few and very limited values, I would suggest going with Combo, entering the list of numbers as value as well as displaying text, and setting 0 as default.

 

Something like

 

Userlevel 3
Badge

Considering you have a few and very limited values, I would suggest going with Combo, entering the list of numbers as value as well as displaying text, and setting 0 as default.

What makes you say we have few/limited values? Here is a list of Install Pts values on 10 or so SORs:

It can vary quite a bit so not sure whether the Combo approach is the way to go...

Userlevel 7
Badge +8

I should have mixed this post with someone else that had a few attributes assigning 0-10 and then using the assigned values to determine of an installation difficulty as I recall.

 

If you have an unlimited number of possible values then you need to go with the text and limit the data entry using the mask as apparently, you have done. As long as you do not have non-numeric values in your inputs, the provided formula will do the work for you.

Userlevel 3
Badge

I should have mixed this post with someone else that had a few attributes assigning 0-10 and then using the assigned values to determine of an installation difficulty as I recall.

 

If you have an unlimited number of possible values then you need to go with the text and limit the data entry using the mask as apparently, you have done. As long as you do not have non-numeric values in your inputs, the provided formula will do the work for you.

I am getting the same error message with the formula.

 

Userlevel 7
Badge +8

Is it passing the validation test?

Userlevel 3
Badge

Is it passing the validation test?

Yes it is passing validation test but erroring on View Inquiry.

Userlevel 7
Badge +8

Sorry, I am out of ideas.

Userlevel 7
Badge +8

If you remove the *100 from the formula, does it work?

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2022  Acumatica, Inc. All rights reserved