How to get date in a Custom Object from a date field in Archer? - archer

I have tried getting the value with JavaScript functions but getting Invalid date.
Also,
var dat = new Date(String(Archertech.UI.GenericContent.GetInstance().getFieldValue(ScheduledDate,false)));
gives the date from one field only, but there are two date fields.
I wonder where can I get the list of functions like
Archertech.UI.GenericContent.GetInstance().getFieldValue(ScheduledDate,false)

There is a Client Manager frontend API that is available which has many functions that will give you the values from fields in the Application.
To get all the function list :
Add a new Custom Object named "debugger" with the code debugger;
Save that object > Open Application > Add a new / Open a record
Open Browser's Console i.e F12 > Developer Tools > Console
Set Target to frame : Record.aspx
type "$CM." will get you a list of supported functions
Now, to get a date field value, use $CM.getFieldValue(fieldId);

Sourabh, you'd have to call the CM.getFieldValue() function for each date field you want to get the value of. There is no such function to retrieve all date fields at once.
RSA Archer doesn't provide any documentation for client-side functions.

Related

How to filter with "_links" properties params on API.v3 in openproject

I just learned to use "hypermedia rest API" on openproject
I want to use "filter" param with "_links" properties on API but not know-how
Example:
http:/<my_domain>/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}, "_links":{"type":{"title":{"operator":"=","values":["Box"]}}}]
==> My Question:
i not known use to "_links":{"type":{"title":{"operator":"=","values":["Box"]} params filter. Now, result is not filter for "_links"
And show me books name to learn API for to beginner
? (https://www.oreilly.com/library/view/restful-web-clients/9781491921890/ch04.html#callout_hal_clients_CO1-1) -> is this ok?
Help me, please!
Thanks!
Image for my api
What I understood you wanting to achieve is getting all work packages in the project "design" that have been updated last within a certain time interval and that are of the type "Box".
The filters in OpenProject do not differentiate between native properties (like updatedAt) and linked resources (like type) when it comes to the structure of the filters. The syntax is always
{"<name of the filter>": {"operator": "<operator>": "values": [<list of values>]}}
When it comes to the filter values however, there is a difference. For linked resource the client is expected to use the id whereas native value like an integer, string or date is required for the native properties.
For your request the above requires the client to issue the following query:
GET http://domain/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}}, {"type":{"operator":"=", "values":["10"]}}]
I took the id of 10 for the type "Box" out of the screenshot you provided.
To get the filter values of all available filter you can call
POST http://domain/target/api/v3/queries/form
with a body of
{"name":"default","_links":{"project":{"href":"/api/v3/projects/design"}}}
The response will list all available filters in the _embedded/schema/_embedded/filtersSchema array.

Netsuite Advanced PDF BOM

I am creating a print out for BOM using advanced pdf. I am trying to get get the value of the Start Date from the work order but in the print out, it is empty. I set this using ${record.startdate}. Is this correct? Is there another internal id for start date and end date in the work order?
Thanks!
If the object passed to the pdf generator name is "record" offcourse you can reference is as it is. It depends on the passed parameter name. If you are modifying existing html check the rest of the script and you will see if its 'record' or not.
You can reference with ${record.startDate} and ${record.endDate}
All the available fields for the object can be found here.

Can we send multiple Properties in Json of Analytics(IBM MobileFirst)

I was asked for a usecase where I have to filter ActionEvents on type of Page that action is being is being called from.
Example
use case: I have a login page and I have to capture analytics of its events
Can I do something like this
String json = {"PageLevel":"LoginPage","ActionLevel":"LoginButton"};
WLAnalytics analytics=new WLAnalytics();
analytics.log(message, new JSONObject(json));
Will this work... can we create custom chart with first property being ActionLevel and filter it as per PageLevel.
No this will not work. Custom analytics can only be logged in key value pairs i.e. you cannot send two key value pairs in one JSON object. This is a good idea though, I recommend you submit an RFE.
Submit a Feature Request

RSA Archer user cannot specify a date in the future / past

Has anyone any good patterns for RSA Archer validation which prevents a user from saving the record when a given date specified is in the future (or past)?
Currently I am catching this using calculated fields after the data has been saved, in a data exceptions report. But ideally I would like to catch this early prior to the user saving the record.
I would suggest that you use custom object in this case.
So remove the basic onclick attribute of the SAVE and APPLY button.
In your custom object, check if the entered date matches the system date (or the time-zone you need). Set a flag. Based on the flag value, you can call the actual function call of the SAVE or APPLY button.
Hope that helps!
Alex,Tanveer is correct. You have to use a Custom Object with embedded JavaScript code to implement described functionality.
You will need to create a function that will validate the value entered by the end user and either accept it or make user correct himself.
Now, you have two options how to do it:
1. You can attach your validation function to the Save and Apply buttons as Tanveer described. I have shared a similar code in the following question before. You can review it here: LINK
2. You can attach your validation function to the element you plan to validate directly. So when user is done with given input element and input element loses focus your function will be called. Here is a sample code with jQuery:
$('#elementid').blur(function() {
// validate entered value here
// if required show a pop-up message
WarningAlert(msg, title);
});
Good luck!

How to use a hidden page item within an SQL report query without submitting

Using: Oracle ApEx 3.0.1
I have a SQL report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value entered to my hidden item, so that it can be used within the where condition of my SQL but this would need to be done without actually submitting the form.
At the moment, I can set the value via an on-demand process but my SQL is still not returning any values as the hidden page item within the query is not set (as page has not been submitted).
I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
Since you are on Apex 3, you don't have dynamic actions, but that doesn't hinder so much.
I've set up an example on apex.oracle.com. To get in the workspace, use workspace 'tompetrusbe' + apex_demo / demo.
There is a dynamic action there, which can do the work too, but i've disabled it.
What you need to make it work:
an ajax callback process, with the following line:
apex_util.set_session_state('P2_PAR_ENAME', apex_application.g_x01);
Give your report region a static id, i called mine 'report_emp'. This so i can easily retrieve it.
In the javascript region of the page, you then need to call the app process, and then refresh the region. Also bind the event which needs to trigger this action. I've done it here through the onchange event of the parameter textfield.
function refresh_report(oTrgEl){
//alert('refresh: ' + $v(oTrgEl));
//calling the application process which sets the session state of P2_PAR_ENAME
var oGet = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=set_session_state', &APP_PAGE_ID.);
oGet.addParam("x01", $v(oTrgEl));
oGet.get(); //the app process just sets something, it returns nothing
//refresh the report region
$("#report_emp").trigger("apexrefresh");
};
function bind_events(){
//call this onload
$("#P2_PAR_ENAME").change(function(){refresh_report(this);});
};
In the query of the report i use where ename like '%'||UPPER(:P2_PAR_ENAME)||'%'.
When you type (for example) 'bl' in, and tab out (to trigger the onchange), the region will refresh and will be filtered.
You'll just need to adapt to your solution :)