Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-08-02 03:19 AM
The below function is reading values of values list field but i am not to get if the values list field is calculated. Please help me to get the value of calculated values list field through custom object
"ArcherTech.UI.GenericContent.GetInstance().getFieldValue(fld_Id, false);"
We are using Archer 6.3 P3 version.
2019-03-28 11:39 AM
As of now i have used only two countries for check and i am writing this calculation in subarea field
IF
(OR
(CONTAINS(ANY,[Country(s)],"UK"),"UK-Area",
(CONTAINS(ANY,[ Country(s)],"US"),"US-Area")))
when it executes it just shows subarea as UkK-area though both countries are selected as multivalue which has UK and US and i expect both subarea should display
on layout
countries : UK Subarea: UK-area
US US-Area
But what i am getting is
countries : UK Subarea: UK-area
US
Please suggest.
2019-03-28 11:51 AM
The issue is when the first OR evaluates to True, Archer moved on in the calculation.
You'll probably have to go this route, https://community.rsa.com/thread/35766
Advisory Consultant
2019-03-28 11:57 AM
You first need to build requirement for AND, and then for OR.
Meaning, like David says, your calculation checks for either of conditions, while you first need to check of both being True.
2019-04-23 10:14 AM
Time to resurrect this from the dead. I just tried this code in 6.4 SP1 P1 and now it only works with <div>. Is there any way to make this sort of code version safe (or safer)? For that matter, is there anywhere to find a reference that says that if you have field of type X, here is the best/safest way to pull/update its value? There are lots of good examples in here, but they often conflict or are version specific or use not-the-most-recommended techniques.
Thanks,
Ron
2019-04-23 10:18 AM
Ronald,
I am afraid these are archer version specific die to the UI changes. What I usually do, o use dev tools and inspect elements from browser, and then I know what JQuery code I need.
2019-04-23 10:35 AM
Ilya,
I guess my question boils down to what's the safest JQuery code to use. For example, I have two text fields, one is read-only and the other is editable, and I can use $CM.getFieldValue(). However, my other field is a calculated text field and I have to use this span/div method (at least I can't get $CM.getFieldValue to work). What is $CM and what are the circumstances where it can be used versus using these other methods that are more dependent on the UI structure?
Thanks,
Ron
2019-04-23 10:51 AM
That was my experience too, but for same field types $CM is not returning what is needed. Also, it works only in Edit mode.
Thus I always use JQuery tag specific code. But it is not version proof, while $CM is.
David may shed light on where $CM provides values and not, and you can use ot then everywhere needed for Edit type of Custom Objects. For the rest, JQuery is better, but you need to check it every major upgrade.
2019-04-23 02:44 PM
$CM is shorthand for ArcherTech.UI.ClientContentManager.GetInstance().
You don't need to know the element type (span or div) if you do it this way:
$CM.getFieldById(fieldId).clientId will give you the field's element ID. IDs should be unique, and jQuery's ID selector is '#'. So $('#' + $CM.getFieldById(fieldId).clientId) will give you the jQuery object for that element, regardless of whether it's a span or a div or another type of element. For a calculated field, you can do this to get the field's value:
$('#' + $CM.getFieldById(fieldId).clientId).text().trim()