Hi, I am facing an issue where I want to add all the value of a column and display it on the top of the gridfield, The source of data is a recordType (Adding the code down below), Please help me with this.
{ a!textField( label: "Sum Of Values", labelPosition: "JUSTIFIED", value: a!currency(isoCode: "USD", value: 0), readOnly: true ), a!gridField( labelPosition: "COLLAPSED", data: 'recordType!{b43afdfb-93b4-4d94-9708-ffa71f87754a}MWM Test', columns: { a!gridColumn( label: "Value", sortField: 'recordType!{b43afdfb-93b4-4d94-9708-ffa71f87754a}MWM Test.fields.{2682c5c7-76eb-4a9a-abf5-d409f2bc3f80}budget', value: a!currency( isoCode: "USD", value: fv!row['recordType!{b43afdfb-93b4-4d94-9708-ffa71f87754a}MWM Test.fields.{2682c5c7-76eb-4a9a-abf5-d409f2bc3f80}budget'] ), align: "CENTER", width: "NARROW" ) }, pageSize: 100, selectable: true, selectionStyle: "ROW_HIGHLIGHT", selectionValue: {}, selectionSaveInto: {}, height: "MEDIUM_PLUS", showSearchBox: false, showExportButton: false, showRefreshButton: false ) }
Discussion posts and replies are publicly visible
What is the error you are receiving?
RecordType can only be used in few components and we cannot pass that data from gridfield.data to text field.
I would query data into local variable using different functions like queryrecordtype etc.. and pass that as data onto gridfield; as well write sum() on textfield value from this queried data.
a!localVariables( local!data: a!queryRecordType( recordType: "tyour record", fields: { }, pagingInfo: a!pagingInfo(1,50) ).data, { a!textField( label: "Sum Of Values", labelPosition: "JUSTIFIED", value: a!currency( isoCode: "USD", value: sum(local!data["tyour record",]) ), readOnly: true ), a!gridField( labelPosition: "COLLAPSED", data: local!data, columns: { a!gridColumn( label: "Value", sortField: "your record", value: a!currency( isoCode: "USD", value: "tyour record", ), align: "CENTER", width: "NARROW" ) } ) } )
Use query Record Type with sum function in order to get the value expected.
Use the sum() for the record data. It will give the expected results.
Can we implement userfilter (record filter) in this approach as we have some user filters as well above this grid ?
we cannot apply userfilters without recorddata