Call 2 Functions during onclick

0
Hello, I am using a Data View(dataView7) that is listening to a List View (listView1). When listView1 is clicked, the message is shown in dataView7.  Ex:   I want to change a variable (isRead) to set to true once this item in the listView1 is clicked on. However, I am unable to assign an onclick action to listView1 because there is a widget listening to it (I get an syntax error). I have been trying to think of solutions to solve this. Is there a way to add 2 functions to an onclick? Is there a way to edit the Java function to be able to give the data to dataView7 while also calling a variable change? OR, can I call a function in my dataView1 so that as soon as it is clicked on I call another function? I know I can embed a Javascript function into that listview, but I don’t think I can change the variable in my domain model to reflect it. Can I call a Javascript function to call a microflow? OR, can I call a microflow automatically once this dataView displays data?   Any help would be appreciated. Thanks.
asked
3 answers
1

hii Andrew Bernhardt 

i have a trick to achieve your task as you describe in your Question your Data view is listening to your listView 

so now place a microflow timer widget inside your Dataview that is listerning to your list 

see in second screenshot

you can download microflow timer widget from marketplace

 

and set the value of microflow timer widget according to below picture 

after that now select the microflow to change the IsReaded Varibale false to True 

so click select 

then click on new to create new microflow and Give It a Name for example OCL_Change_IsReaded

 

Now Go to newly Created Microflow here you will get your entity parameter already if not then add parameter 

in microflow 

here firstly you can check from value or to email is empty or not using Decision (Optional )

if you Check then write expression in decision 

$Email/From!=empty

 

and on condition true just place change Object and on False condition place a end event see above picture of microflow 

and in change object activity select you entity input parameter  

(make sure refresh in client and commit should be yes )

and the click on new to add member 

and then set IsReaded variable true 

 

after change object activity configuration in your microflow your microflow is completed 

so when you click on row of your list view for this particular object isReaded Value will be changed false to true

Edit :- 

Shubham Mahajan is also right as i create microflow can also be called after place a data container inside list and edit onclick action available there 

but make sure put all the data / attributes of list inside this container so if anyone click anywhere on the row microflow will be called 

plase accept answer if its work

i hope it will help you 

answered
6

You can add container inside the list and then you can use container’s on click event.

Hope this information will help you.

answered
5

Hi Andrew Bernhardt,

Simply place a new data view inside the listen to widget data view, and make source as microflow in that microflow perform your action what ever you wants.

Thanks. 

answered