cancel
Showing results for 
Search instead for 
Did you mean: 

Front end Script cannot access List data fields

Former Member
0 Kudos

Hi, I'm trying to implement some front end scripting and can't seem to access the data elements bound to a AdvancedListPane Control.

I'm expecting to be able to perform an operation similar to:

$data.DataList.Get(0).FamilyName

and then perform some operation that particular cell.

Unfortunately I can never get a script file to access the elements inside a list. Can anyone help please?

Thanks

Alexander Ludwig

Accepted Solutions (0)

Answers (1)

Answers (1)

vinodkumar_kommineni
Active Contributor
0 Kudos

Hi Alexander,

I believe I had also faced similar issue which was fixed by using Resolve.

Try something like  coll = $controller.Resolve('/Root/DataList')

Incase if you are looking at the value of FamilyName in current record for which this script is running you can also write fname = $controller.Resolve('/Root/DataList/FamilyName') and it would get the current records F Name.

Also check if the name of your collection within Datamodel is Datalist or it is renamed by any chance.

Regards

Vinod

Former Member
0 Kudos

Hi Vinod,

I haven't renamed it, but the Intellisense does not display any available methods or parameters other than @RowCount, @HasLeadSelection, @LeadSelectedIndex.

I am actually very new to using the front-end scripting and I am trying to set the BackGroundColour properties of the individual cells.

Thanks

Alex Ludwig

vinodkumar_kommineni
Active Contributor
0 Kudos

Hi Alexander,

Then $controller.Resolve('/Root/DataList/XX') would help you in getting the element(XX) value in current record.

Regards

Vinod

Former Member
0 Kudos

Hi Vinod,

If my datalist is set up as follows:

Do access row 0 of the CarParkID column using:

$controller.Resolve('/Root/DataList1/@0/CarParkName)

Also, since I can't access the full Intellisense, do you know how to change the background color?

vinodkumar_kommineni
Active Contributor
0 Kudos

Hi Alexander,

I had never done the colour change but it seemed to be interesting to explore on this. Below is my analysis.

You can have only fixed colours for the background of a column within the Table/ALP as in below image.

Select a particular column and you should see a property called Background Colour

Select on the field and you should see something like below.

In the above image you see the radio button Calculation Rule where you can write some scripting to modify it dynamically.

The code will look something like below.

result = 'STANDARD'  // This is a fallback value in case the if condition below is not satisfied.

if( $currentrow.xxx == 'xx' )  // Here xxx should be the element within the table

result = 'BADVALUE_DARK'   // This is one of the value from above screenshot.

end

$currentrow would give you the current row and you can read any element.

So this way you can also colour a column based on value in another column

It seemed to be impossible for me to get the index of the current row which is displayed, kind of a lacking feature I guess.

Hope this helps

Regards

Vinod