Solved

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


Userlevel 5
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?

icon

Best answer by lauraj46 13 October 2023, 04:48

View original

17 replies

Userlevel 7
Badge +15

Hi @jwarren 

Can you share the setup of the Attribute?

Userlevel 5
Badge

 

Userlevel 5
Badge

Any thoughts @

Hi @jwarren 

Can you share the setup of the Attribute?

Any thoughts?

Userlevel 7
Badge +17

Hi @jwarren  Can you please share the GI here?

Userlevel 5
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 5
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 5
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 5
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 5
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?

Userlevel 7
Badge +4

@jwarren Are you still working on this Attribute issue? Can you provide an update of where you are at on the issue if still working on it?

Userlevel 7
Badge +7

Hi @jwarren ,

Have you tried without the conditional?

CDbl([FSServerOrder.AttributeINSTALLPTS])*100

If you do need the conditional formula, then instead of using the virtual field you could join with the CSAnswers data access class on the NoteID field.

Hope this helps!

Laura

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 — 2024  Acumatica, Inc. All rights reserved