cancel
Showing results for 
Search instead for 
Did you mean: 

Addition of two rows values in table using formatted search

Former Member
0 Kudos

hi all,

i have created one UDF field in market document rows, now in AR invoice i need to add the values in the UDF fields of two rows, want to show it in anather outside UDF in title. kindly suggest me some query to track that.

Ex:- i had entered two items in rows and

for first UDF row i have given 20

for second UDF row i have given 30.

now i need to show sum of the two UDF in two rows in title UDF.

kindly give me some query used for formatted search to do this task.

regards

sandip

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member583013
Active Contributor
0 Kudos

Sandip,

If you are Ok if the user can press shift+F2 and manually trigger the query from the user field then it could be done after the Invoice has been added. This is possible as the rows value is available in the database and a Sum of the U_A column can be easily calculated.

Other wise if you want to do it automatically it has to be done using

The Transaction Notification Stored Procedure provided by SBO.

Regards

Suda

former_member583013
Active Contributor
0 Kudos

Sandip,

To the best of myknowledge When you try to take the row value to the header the results of the Formatted Search are not consistent.

but for your interest, I am giving below the logic to work this out.

You need two Header level user fields. One to copy the row user fields value and the other to store the sum.

You can create a simple SQL "SELECT $[$38.U_UserFieldName] (substitute with row level user field name) and attach it to the first header level user field and make it Auto refresh on doc total.

Then Attached SQL "SELECT $[ORDR.U_HeaderUserField1] + $[ORDR.U_HeaderUserField2]"

The results could be flaky because the header user field takes the value of the active row and sometime it only considers the first row active though you might be entering the second row of data.

My recommendation would be to Use The Transaction Notification Stored Procedure for this by which you can be absolutely sure that the Header User field will have the sum.

Let me know if you need directions for this.

Regards

Suda

Former Member
0 Kudos

hi

i need some other thing.

in AR invoice when i have only one UDF field,

i have entered two two items in two rows and given come value in the UDF field column, here the column is same

ex U_A is the UDF NAME

in AR inclide tabel Title UDF

-


B = 30

Item No. qty unitprice total A

-


I0001 5 INR100.00 500.00 20

-


I0002 3 INR200.00 600.00 10

-


here in A UDField i need to add 20 + 10 and want to so the result in Title UDF named as B.

is their any process to do that.

regards

sandip