Scheduled agent in Lotus Notes - lotus-notes

Since I don't see the option in schedule properties of an agent, I was wondering if it's possible to run an agent once every 3/6 months, or even every year?
I only see -more than once daily,daily,weekly,monthly,never..

Pick the closest option in schedule properties, eg monthly, and then add code at the beginning of your agent that checks the date and depending on the result either exits without doing anything, or continues running the main body of the code. Works fine with agents written in lotusscript, never tried it with #formula.

Related

Can a SharePoint "Delay" action be resetted using a variable while its active?

Im creating a workflow for approvals using power automate. I also have this reminder system set up to remind them every hour for 4 times and then once a day afterwards. This works when I have a parallel task set up, but for this specific loop in the approval, im using apply to each since i can add as many people to review myd ocument as I want. I notice that I can't reset the delay action while its active because it is still running. The only way it gets reset is that the delay action is finished and starts the loop again and then the variable gets reset.
This works if the loop isnt inside an apply to each and the reminder system works as well.
enter image description here

NetSuite, Assembly Build: how do I force a client script to detect the AB's creation?

So I have a script that runs on create of Assembly Builds. It works perfectly when creating the AB manually but when the Assembly Build is created from a PO and then an IR I get an issue. It seems that because the transaction is generated automatically by NetSuite it does NOT trigger my User Event scripts afterSubmit function and then the development does not run.
Any ideas on how to force it to trigger the UE?
Netsuite has a hard limitation that one UserEvent script cant trigger another UserEvent script. (maybe their worst idea ever, but it's a thing)I'm guessing that the PO is generating the AB in its UserEvent script, and that is why the AB's userEvent script is not firing.
To get around this, you could write a scheduled script that processes any new AB's (maybe add a field that gets set when it is processed), then in the P.O. and any other relevant records afterSubmit events, you could tigger the scheduled script to handle any new assembly builds.
However you choose to solve it, you will likely have to do it in the afterSubmit events of the PO IR records.
adding on to simons comment on the user event deployment under the context filtering you need to choose the execution context like user interface , user event script , csv import to let your script only execute on the following occasions

Work Order Status Change - Triggering Script when Work Order is created due to 'Special Order Item'

I'm having an issue where I have released a beforeSubmit UserEvent script that automatically changes the work order status to 'Released' based on criteria I have chosen (specifically that the work order is related to a specific customer/entity).
The script changes the work order to released (as expected) when:
I create a work order from scratch and select the customer
have a work order that is created from a sales order (ie the netsuite 'special work order item' functionality) and go into the the planned order and edit/save.
However I want this to work when the work order is automatically created from the sales order, using the NS 'special work order item' functionality.
I dont believe the issue is the code itself - I think it has something to do with the 'special work order item' and possibly the context settings on my deployment. Right now I have the 'event type' set to All and context filtering set to ALL.
Has anyone run into this issue?
My other thought is I coud probably run a scheduled script that sets these types of work orders to released but ideally would like to go the userevent route first.
I tried with the After Record Submit function and it worked.

Github checks API vs check runs vs check suites

I want to understand Github Checks API so that I can use them to retrieve data. On following Github documentation https://docs.github.com/en/rest/guides/getting-started-with-the-checks-api I am able to derive that check runs are associated with the sha of the change and at each commit on branch check suite is created. Checks API helps in getting all this information. But I want more clarity on three of them in terms of differences. Can anyone please explain these three terms using simple example and terms?
So, first of all, the GitHub Commit Statuses API is separate from the GitHub
Checks API (includes suites & runs), so let's look at them individually first then I'll explain the differences.
Before we get into it, I want to differentiate a PR Check from a Check Run, to avoid confusion. A PR Check describes the current state (trying not to say status here 😉) of a given job or task running in CI or elsewhere on a specific PR commit. These can be created via either a Commit Status or a Check Run. All the items in the pink box below are PR Checks, notice the Hide all checks button.
GitHub statuses - API
I see this as the simple, all-purpose API for reporting PR Checks for a given commit. It's easy and doesn't require jumping through hoops to just display a simple result of a PR Check for a given commit. This API also came before the check API so it's a little less powerful.
Pros
Simple and easy API
Simple relation with context as the identifier.
Can have a fully customizable text description on the PR Checks UI.
You can create statuses as a user with a Personal Access Token (aka PAT) without needing to create a GitHub App, though does work with GitHub Apps too!
Cons
Limited status options, only allow error, failure, pending, success, no conclusion subset option to define completed jobs like Check Runs.
No concept of job timing or duration.
No grouping of statuses, like Check Runs are grouped into Check Suites by their GitHub App
No annotations
No detailed output logs. This is not too important as you could just link to the URL where the actual PR Check was run such as in CircleCI, Jenkins, etc. But the user is not always authorized to view these runs so the output could be helpful for open source repos that have non-public CI.
GitHub Checks - API
The Checks API is the latest and greatest tool for displaying task results on commits, which can essentially do everything the Commit Statuses API can do and more. Check Runs belong to one Check Suite, one Check Suite can have many Check Runs. You can only have one Check suite per commit (i.e. head_sha) per GitHub App, attempting to create another for a given App will just return the previously created Check Suite. Thus, a new Check Run is automatically assigned to the Check Suite based on the authenticated GitHub App, you cannot manually assign Run to Suites.
Contrary to statuses, Check runs are identified by an auto-generated check_run_id and not a context string.
I haven't touched too much on the Check Suites API because they are really just a grouping of Check Runs which is pretty self-explanatory and they don't affect any of the PR Checks UI, only the grouping of Check Runs in the checks tab. One thing to note is that by default you can create a Check Run without having to first create a Check suite and GitHub will just create a new Check Suite for you.
Pros
Greater granularity of status/conclusion for a run.
A lot of power to display the result of a PR Check.
Can provide run context via output summary in Markdown.
Can create annotations for specific lines of code to add information about the analysis performed, like linting error for a given line of code. These will show up in the PR files tab UI similar to PR code comments as well as in the PR Checks tab with any other Check Run output.
Has time awareness to report on durations automatically with little effort.
Cons
A little more complicated API and relationships to manage.
Part of the description in the PR UI is auto-generated based on the status conclusion and duration of the check run task.
Cannot be created via a user PAT, must be created from an authenticated GitHub App. Read access to this API does not require authenticating as a GitHub App.
One edge case you likely won't come across but is good to know: If you are creating a new Check Run with the exact same name of an existing check run under the same authenticated app. The resulting behavior is a little strange but doing this will create the new Check Run under the same name, but will not delete the existing Check Run. However, the Check Suite will not see or link to the existing Check Run, even in the PR UI. BUT!! If you change the name of either such that the runs now have unique names, it will be linked up again. It seems GitHub just does a sort by date and then filters by unique names when looking up Check Runs in a Check Suite. This does not apply with identical names from different authenticated apps.
Comparisons
Below is a mapping of sorts to compare similar options between the Commit Statuses API and the Check Runs API. They are not exactly 1:1 but similar.
Commit Status
Check Run
Option Desciption
sha
head_sha
These are equivalent with the minor exception that the Commit Status is linked to the sha directly, whereas the head_sha is linked to the Check Suite that the Check Run belongs to.
context
name
The context is used as an identifier but both define the title of the PR Check in the PR UI. Because Check Runs are tracked by the check_run_id the name option may change without creating a new Check Run. This is not the case for context, changing the context will always create a new Commit Status. You may not have duplicate names for Check Runs created with the same GitHub App, see note above.
context*
external_id
The external_id is meant for keeping track of Check Runs without having to store ids or always keep the name constant. This is only somewhat similar to the context option but only for the purpose of identifying the Check Run.
description
output.title
The main difference here is that description gives you the full space to work with, where output.title will be displayed after the auto-generated status string.
target_url
details_url
These are somewhat equivalent, the first difference is that target_url will not show unless defined whereas details_url will default to the check run URL in the PR UI. The other difference is the Check Runs Details button on the PR Checks UI will always link the the Checks page which will present a link to the details_url if defined.
state
status
These are very similar but have slightly different allowed values but effectively appear the same in the PR UI.
N/A
conclusion
This just shows the increased power of the PR Checks API where you have more granular control over the PR Check status, though not a big difference in the UI, see example variations below.
N/A
started_at
No comparable option for Commit Statuses.
N/A
completed_at
No comparable option for Commit Statuses.
N/A
actions
No comparable option for Commit Statuses.
N/A
output
No comparable option for Commit Statuses.
N/A
output.annotations
No comparable option for Commit Statuses.
* Only somewhat similar, not a direct equivalent.
PR Checks UI Component mappings
I've taken a simple PR Check and highlighted the differences between the elements of the UI between the Commit Status API and the Check Runs API. Very similar but slight differences.
Below are example variations to relate the options to their impact on the
PR Checks UI.
Commit status variations
Check Run variations
If a check run is in an incomplete state for more than 14 days, then the Check Run's conclusion becomes stale. Only GitHub can mark Check Runs as stale.
Checks Tab in PR UI
The Checks Tab in the PR UI will display all created Check Suites and their child Check Runs and allows you to set the output option to control the content of this page. This page would also show images and annotations if you defined those too.
One final note: You cannot DELETE any Commit Status, Check Run or Check Suite once created, only updating is allowed. With these statuses being so ephemeral this is not that big of a deal but in case you were wondering.
Update (6/21/2022)
I found two more quirks to explain. First, the details_url for Check Runs does not set the value of the Details button, instead the Details button actually always redirects to the Checks page which has a link to the details_url if defined.
Second, once a Check Run status is set to 'completed', there is not way to un-complete the Check run. But you can get around this by creating a new Check Run with the same name and set that status to something other than 'completed'. See this edge case with duplicate-named Check Runs explained above in detail.
Update (6/29/2022)
As mentioned above, the Check Runs API keeps track of the duration of the run. It is important to note that the started_at time is set only once whenever a check run is created, regardless of the defined status. For example, if I trigger a CI build and set all jobs status to queued, the jobs run duration will be inaccurate. A good way to fix this is to always set the started_at time whenever you set the status to in_progress. Something as simple as const started_at = new Date().toISOString() (javascript) will do the trick.

Recurring Event or Automatically push Entry date forward in ExpressionEngine

I've got an events channel set up on a client site where everything is working just fine. However they now have a single event that runs every Sunday. Due to using the start_on parameter to only show events from the current month onwards this recurring event is now displaying a blank page.
Is there a simple way to have the entries publish date automatically updated to the current month or somehow display recurring events correctly. Client is unwilling to spend money on a new module such as Solspace Calendar.
You could set up a cron job on the server to run a PHP script which would modify the entry date on your recurring entry.
Yeah I see your dilemma, Sean - separating the event from its month and year (year in particular) to have one even display multiple times... What about using MX Clone to simply allow them to create multiple instances of the same entry (granted, they'd have to adjust the date for each one too, but that can be done en masse from the mass edit screen if you're using one of the native date fields and not a custom date field)?
Could you make the entry sticky? Not sure whether that would override the start_on parameter or not.

Resources