Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-11-07 03:55 PM
I have noticed that saving new record entries to my sub-form does NOT update the 'Last Updated' field of my parent record.
How can I determine if a new sub-form entry has been made for the purposes of sending a notification?
I have tried using the Criteria 'Action Log' and operator 'Changed' but this seems to never evaluate to TRUE.
It seems the parent record is unaware of changes to the sub-form.
thank you!
2019-04-23 03:33 PM
Lee, make sure you add the type attribute "text/javascript" to the opening script element; <script type="text/javascript">
You can either add alert(), or console.log() (must have the browser developer tools open and the console tab selected) at various points of the custom object to see where it's failing. You can either pass text, variables or combination of both in either functions.
Advisory Consultant
2019-04-23 03:41 PM
David,
I had console.log statements galore but there is never a failure. The JSON request and the URL are created and formatted correctly. I even took out all the case statements, hard coded the field IDs and URL, ran it successfully in Dev, then ONLY changed the field IDs and URL for Test and it doesn't work. Is there something on the back end that needs to be done to get this functionality to work, that maybe we've done in Dev but not in Test?
2019-04-23 03:43 PM
I see some hard coded values:
var recentComment = $('div[id*="f12789c"]').text().trim();
var recentAuthorALL = JSON.parse($('input[id*="f12788c"]').val())
Any of these are different in TEST?
2019-04-23 03:47 PM
Those are the field IDs for the subform and yes, they are different in Test, but I have them separated via the case statements. I confirmed via developer tools that those variables are being set properly.
2019-04-23 03:49 PM
Well, I can only think if your API setup is different in TEST. E.g. shielded by SSO, set as not anonymous authentication for API and PlatformAPI web nodes.
2019-04-23 04:07 PM
There's nothing on the back end that needs to be done.
Also the function grabData() should sit outside of Sys.Application.add_load(function() { });.
What you can try doing is add debugger right after $('#master_btnSave').click(function(event){ and via the debugger in the developer tools you can step through the code line-by-line to see what's going on.
Lastly, if your on a newer version of Archer hijacking the Save and Save and Close buttons has to be done differently.
// Hijack Save and Close Button
$('#master_btnSave').clone().attr('id', 'master_customBtnSave').insertBefore('#master_btnApply');
$('#master_btnSave').hide();
$('#master_customBtnSave').unbind('click').prop("onclick", null).click(function(){ CheckUsers('save');return false;});
// Hijack Save Button
$('#master_btnApply').clone().attr('id', 'master_customBtnApply').insertBefore('#master_btnApply');
$('#master_btnApply').hide();
$('#master_customBtnApply').unbind('click').prop("onclick", null).click(function(){ CheckUsers('apply');return false;});
Then call either $('#master_btnSave').click(); or $('#master_btnApply').click();
Advisory Consultant
2020-08-18 09:22 AM
Here's another out-of-box (no data feed) solution using the Schedule/Bulk Action feature available in later releases of v6.
This solution can send subscription notifications as frequently as 1 hr when new/modified sub-form records are added.
Create three fields on the sub-form parent application:
IF(
ISEMPTY([Most Recent Sub-Form Last Updated]),
VALUEOF([Trigger Schedule/Bulk Action],"No"),
IF(
AND(
NOT(ISEMPTY([Most Recent Sub-Form Last Updated])),
ISEMPTY([Most Recent Scheduled Action Updated])
),
VALUEOF([Trigger Schedule/Bulk Action],"Yes"),
IF(
[Most Recent Sub-Form Last Updated] > [Most Recent Scheduled Action Updated],
VALUEOF([Trigger Schedule/Bulk Action],"Yes"),
VALUEOF([Trigger Schedule/Bulk Action],"No"))))
How these fields work together:
The 'Trigger Schedule/Bulk Action' fields compares the most recently updated Sub-form record (Most Recent Sub-Form Last Updated) to a field that is updated by a Schedule/Bulk Action (Most Recent Scheduled Action Updated).
When a new/updated sub-form record is created, the Most Recent Sub-Form Last Updated will be greater than
Most Recent Scheduled Action Updated field.
Next, you need to create a Schedule/Bulk Action associated to the Sub-form parent application.
Lastly, you need to configure a Subscription Notification for your new/modified Sub-form records.