Change expression widget data type (none) to Integer

Good Day Everyone,

I have searched many documentation for a solution to this issue however no luck. I have a Total Value expression (in an editable table) which i am trying to assign before creating a new record. However when i try to assign it gives an error.

I have tried the data conversion function however the there is no NonetoInteger Option.


Grateful for the kind assistance of the community.

App is Traditional Web

Service Studio 11


Hello, 

Can you provide more details? Oml file or more prints?


BR,

Luis

Hi, 

like Luis write, can you give us more details? However, and without know the context of your issue, can you try convert texttointeger()

cheers,

Nuno Verdasca

if you can provides more informations about this would be nice, but are you trying pass null?

Thanks for the quick response everyone. Here are some additional pics.

This is the content of my expression. calculation works well

I am trying to fill my database attribute with the Total Value Expression Upon upload.


This is my assign statement and the resultant error:

SyntaxEditor Code Snippet

OrderItemsTable2.List.Current.OrderItems.TotalValue = ValueFormula2

When i try text i get a similar error: "Text Data Type Required instead of None"


Thanks everyone

Can you please alão send pic of the assign where you got that error?

Try in second condifion of if instance of "" put 0 !? Or try to do the calculation inside the if conditions. Something like: if( abc <> nullidentifier(), GetIten * OrderItems_quantity2.typevalue, 0)

What kind of values OrderItems_quantity2.typevalue returns?

Or if you can, give us the OML.

Cheers,
Nuno Verdasca

Heres the oml attached. 

The widget is on the NewOrderDetails screen and the assignment is being done on the saveorder action (2nd assign)

Solution

Juju,

I can't debug because I miss the core, but I put assign to

your formula from expression, try to do this please.

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue,"")) * TextToInteger(OrderItems_Quantity2.TypedValue)
Solution

And if solve your problem, change your expression to this:


SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue * TextToInteger(OrderItems_Quantity2.TypedValue),""))


Cheers,
Nuno Verdasca

aplogies. Heres the core

If I understood what do you want, if you put this code:

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue,"")) * TextToInteger(OrderItemsTable2.List.Current.Item.Quantity)

or

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue * TextToInteger(OrderItemsTable2.List.Current.Item.Quantity), 0)) 

In both places that I say above, your problem will be solve, but try you and tell me please.


Cheers,
Nuno Verdasca

Nuno Miguel Verdasca wrote:

If I understood what do you want, if you put this code:

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue,"")) * TextToInteger(OrderItemsTable2.List.Current.Item.Quantity)

or

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue * TextToInteger(OrderItemsTable2.List.Current.Item.Quantity), 0)) 

In both places that I say above, your problem will be solve, but try you and tell me please.


Cheers,
Nuno Verdasca


Thanks Nuno. This is the OrderDetails Screen.

The expression (Total Price) is on the (NewItemDetailsScreen)

I know JuJu2.

I suggest you do what you said above.
Put in the assign that is giving you that mistake, one of the expressions I indicated you above.

Please, try to do this... and turn me with a feedback.

Cheers,
Nuno Verdasca

Nuno Miguel Verdasca wrote:

I know JuJu2.

I suggest you do what you said above.
Put in the assign that is giving you that mistake, one of the expressions I indicated you above.

Please, try to do this... and turn me with a feedback.

Cheers,
Nuno Verdasca

Ok will do. Thanks


Nuno Miguel Verdasca wrote:

Juju,

I can't debug because I miss the core, but I put assign to

your formula from expression, try to do this please.

SyntaxEditor Code Snippet

TextToInteger(If(OrderItemsTable2.List.Current.Item.Id<> NullIdentifier(),GetItem(OrderItemsTable2.List.Current.Item.Id).Item.ItemValue,"")) * TextToInteger(OrderItems_Quantity2.TypedValue)

Your solution worked perfectly;never thought of this. Thank so much. Every comment opens up my mind to conceptualize various possibilities. Thanks to Everyone who responded to this post as well. 

God Bless


You don't have to thank me, we are here to help each other. The important thing is to grow every day.
Cheers,
Nuno Verdasca