TrackVia API & App Scripts
-
How can I get current record's id using script?
How can I get current record's (currentValues') id using script on after update or after insert event? I mean the real id in database, like the recordId in the event passed to an integration, instead of the Record ID.
2 votes -
How can I get currently logged in user?
Is there a way to get the currently operating user record in script?
1 vote -
Sorting records in Application Scripts?
It seems that sorting a List of records by a specific field requires the field value to be cast to the underlying data type? If you don't do that, it seems like the fields will sort by object identity or some other undesired key. Am I right about this?
For example, if I have a date field in a record, must I use
(Date)record["MyDateField"] to actually get a correctly sorting date.1 vote -
Before/After Delete App Scripts: Do these work?
It seems the before/after delete app scripts don't work the same way as the insert/update ones, but not 100% sure.
I'm trying to prevent the user from deleting a parent record that has any child records from a certain table attached to it.
The script should be pretty simple. On the parent table:
Before Delete
List childRecords = getChildren "TableName", "FieldName"
if(childRecords){throw new RuntimeException
}
This hasn't worked whenever I've tried it. However I structure it, a Delete app script can't seem to find child records. I'm I misunderstanding something here?
Thanks!
1 vote -
Date Calculations in Apps Scripts
This is probably a very simple solution, but I've been banging my head on this for two days.
I need to populate a date field in a child table with a date stored in a parent record minus 14 at the time the child record is created via Apps Script. Not all child records link to the same parent table, and the child date field needs to be editable, so a calculated date field in the child table is not an option.
I have attempted a calculated datesub in the parent to subtract 14 from the source field, then use…
1 vote -
Can Apps Scripts Populate Link-To-Parent Fields?
I am trying to populate a Link-To-Parent fields via Apps Script and nothing happens.
If copied the format from Drop-down fields, Application User, and Application User Group fields (thinking they would all behave the same), but although the Scripts saves with no errors, and the records can be updated with no errors, the LTP field is not being populated.
If this is possible, can you provide a sample of the code that I can use?
3 votes -
App Script Padding For Child Records Numbers
I've been practicing with Apps Scripts and creating multiple child records.
From the documentation (see below), each child record will be created and numbered incrementally from 1 to the total number of records created (1 to 5).
QUESTION: How do you pad the sequence number as 01, 02, 03... instead of 1, 2, 3.
This is so column sorting is correct when more than 10 records exist.
Thanks
How do I create child records ?
// Create 5 child records
(1..5).each {
addChild “Child Table”, “Link to Parent”, [‘Status’ : ‘Active’, ‘Index’ : it ]
}1 vote -
getChildren function
Regarding the getChildren function described in the app scripting documentation - I think it lacks some info. How do you use it properly?
getChildren "child table name", "link to parent name"
it's not only not working, but it doesn't make any sense: how would trackvia know which parent I am referring to if I only specify the link name, but not the value?
for reference, this is what is written in the docs:
Function: getChildren
Description: Get the associated child records.
Arguments:
Name of the child table
Name of the relationship
Returns:
List of found child records
Example:List childRecords…
1 vote -
Finding records within a certain time interval
Is there a way to find records in a table via scripting that have a date column value greater than a value (as opposed to just equal to it as the method seems to work now)?
1 vote -
Which field types are not supported by app scripts? Can we change this?
I was already aware that app scripts are unable to handle image/document fields(bummer), but it appears they may not support other calculated field types as well... some clarification on the subject would be nice. I would think you might want this published on your developer site as well.
Thanks!1 vote
- Don't see your idea?