Hi,
I just need your help, I would like to know if how to pass the total amount to the field from one of the field in gridtable in form? can you help me on this? thank you
Ivan
Hi,
I just need your help, I would like to know if how to pass the total amount to the field from one of the field in gridtable in form? can you help me on this? thank you
Ivan
you can try this display method scenario is same
Hi Nishant,
Thank you for your response, yes its quite complicated what the client wants because it is not consistent at all. but I managed to set the field as editable since there is a field in the table for the computation.
Ivan
Hi Ivan,
I have got our question now. As you explained, in total amount field data is coming from a display method which is not editable. But in your case it has to be editable, which seems a bit confusing requirement because total amount is sum of field #4 in sumOpportuinityTable, if user is going to edit it , there is no point in showing some of a particular field. Anyways based on your requirement in place of display method you can use edit() method which will make the field editable as well. Perform the same logic in edit method which will return your total amount.
For more information go through the link.
It will help to fetch all the row records of a table.
Till it finds the records in table it will work.
Hi Ivan, you can create a display method in the datasource and put it in the grid. Remark: there will be no data field in the grid control. There will be Data method instead.
Best regards
@Gautam Verma
What is the purpose of "where table1.RecId !=0" ?
Try this it will help you!
static void SumOfField(Args _args)
{
Table1 table1;
;
select sum(Field1) from table1; //Use "where" condition if required
info(strfmt("%1",table1.Field1));
}
You can pass this value where ever you want to!
*If you need to insert this value to gridtable of a form then you can write this code to init() method of that form and assign this value to desire field. So whenever the form is initialized you can see that value in your gridtable field.
Field #1 : smmOpportunityTable.TotalNetAmount()
As-is : Sum of field #4
To-be : Default data is sum of field #4, but user can edit it.
the field #1 is in display method which you cannot simply edit it. I want to edit the total amount. I hope you get the situation. Thank you.
Hi Ivan,
you can write a simple query from the datasource table and fetch the sum of the amount field.
let's say you have a table Table1 and amount field is there. Query will be like :
Select sum(amount) from Table1 where {your condition};
Table1.amount will give you the sum which you can pass as argument._
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,353 Super User 2024 Season 2
Martin Dráb 228,251 Most Valuable Professional
nmaenpaa 101,148