Hi @Akifscommunity,From which screen you are planning to add the custom button? Is it on Debrief Overview? If yes, you can simply use the function setControlValue and Save changes to update the task status. If not and you need to modify the task_status within another screen, what I would suggest is to use generateDataTransaction , saveDataTransaction functions to achieve what you are asking.Please refer the “Example 10—Script-Based Transaction” on the Mobile Client Script Documentation on the correctly usage/example of the above functionality.
Hey @nimesha.kalinga Can you please say, where can I get this document? Please refer the “Example 10—Script-Based Transaction” on the Mobile Client Script Documentation on the correctly usage/example of the above functionality. Cheers! Hi @Shneor Cheshin ,You can find the documentation on the Client Scripts screen in FSM Smart Client. Under the Question Mark Button → “Mobile and Smart Client Scripts”
Hello @Shneor Cheshin It will show the ID’s, but now the variable will only contain the last value from the loop. In the end I would like to have the variable “myID” containing all ID’s from the loop. Hi @drooij Can you try the below,var strListOfId = "";for(var i = 0; i < size(data); ++i) { var myID = data[i]["id"]; strListOfId = stringFormat("{0}, {1}", strListOfId, myID);}alert(strListOfId);apologize for the syntaxes as i haven’t had time to test it. But your requirement should be possible with using the stringFormat function
@GDFAPIETRZAK As the previous answer explains, to completely handle the above scenario you would need a code customization for mobile. On configuration level,Assuming user will only using buttons within fsm (and not the OS level buttons like back, home),You should be able to override the Next workflow button using a client script (before the user proceed to the next workflow screen). With the use of client script functions like getFromCache, setCache you can capture that the user has changed the note field on the screen and force the user to save before (or save changes using saveChanges() function) proceeding to the next workflow screen.
Hi @drooij, Assuming the question is about FSM Mobile, it uses SQLLite database which uses somewhat different database functions. Can you try using the following example. Which calculates difference of seconds between two dates (date vs current date) select task_id, created_dttm,Cast (( JulianDay(date('now')) - JulianDay(created_dttm)) * 24 * 60 * 60 As Integer) as resultInSecondsfrom task
Hi @Hasara Dinu, Since your requirement is always fetching the data from the 1st row,Can you try using the SelectionChanged action event along with the getDataTableSelectedRows("part_need") function You might have to add some constraints into the client script .as it runs on other events as well.
Hi @nimesha.kalinga , Thanks for the reply. Is there something missing in your query? Because JulianDay is not definend? “'JulianDay' is not a recognized built-in function name.” Hi @drooij , can I know where you have tried executing the above function? Is it on the Mobile database?Attaching the results I’m getting when I executed in the mobile database. Query:select task_id, created_dttm, Cast ((JulianDay(date('now')) - JulianDay(created_dttm)) * 24 * 60 * 60 As Integer) as resultInSeconds from task
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.