how to show button if there are two roles Lotus Formula script - lotus-domino

I have a Page in Lotus, which has an action button.
This button must be not visible when user is not part of role Admin or Supervisor.
The way i did this is by adding this formula:
#IsNotMember("[Admin]"; #UserRoles) | #IsNotMember("[Supervisor]"; #UserRoles)
But it does not work..
If I have only 1, like: #IsNotMember("[Admin]"; #UserRoles) And the role Admin, then as admin I can see it.
But I also would like to have that if user is from role Supervisor and not Admin that he still can see the button.
What to do?

Knut's answer is correct. My answer shows why, and gives an approach to hide-whens that almost always makes them easier to figure out.
Notes has been using hide-when formulas forever, but people really tend to think in terms of see-when in their requirements! We know when we want to see things (when we're Supervisors or Admins in this case). And we're really bad at turning those see-when requirements into hide-when formulas because we're really bad at remembering DeMorgan's Law, which says things like: ^(P & Q) == (^P | ^Q)
So if we state the requirement this way:
Hide when the user isn't a Supervisor or an Admin
we tend to have trouble turning it into the correct formula with two #IsNotMember calls (which are implicitly logical Nots), because we forget that Ors have to turn into Ands in order to get it right. But if we think of it this way:
See when the user is an Admin or the user is an Supervisor
It's easy to see how to express it:
#IsMember("[Supervisor]"; #UserRoles) | #IsMember("[Admin]"; #UserRoles);
Or using the power of formula language lists, we can shorten that to this :
#IsMember("[Supervisor]": "[Admin]" ; #UserRoles);
To turn that into the equivalent hide-when, all you need to do is put a logical Not around it like this:
! (#IsMember("[Supervisor]": "[Admin]" ; #UserRoles));
You can do that with any see-when formula - just surround it with parenthesis and put a ! in front of it, but in the special case of a formula that just uses #IsMember, you can just change it to #IsNotMember, which brings it back to Knut's solution.

Formula
#IsNotMember("[Admin]" : "[Supervisor]"; #UserRoles)
returns #True if user has neither role "[Admin]" nor "[Supervisor]". Use this as hide-when formula for your button. Only Admins and Supervisors will see the button then.

Related

Questions related to splunk builtin macros in correlation search

I am not sure if this is the appropriate forum to ask this question, but really need help and I am stuck. So here goes : I am exploring splunk enterprise security and was specifically looking into analytic stories and correlation searches.
For example :
Analytic story : Trickbot
Correlation search : Attempt to stop security service
| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.process_name = net.exe OR Processes.process_name = sc.exe) Processes.process="* stop *" by Processes.dest Processes.user Processes.parent_process Processes.process_name Processes.process Processes.process_id Processes.parent_process_id
| `drop_dm_object_name(Processes)`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
|lookup security_services_lookup service as process OUTPUTNEW category, description
| search category=security
| `attempt_to_stop_security_service_filter`
I am trying to understand what exactly this code is doing, but stuck at these macros like security_content_summariesonly, drop_dm_object_name, security_content_ctime, attempt_to_stop_security_service_filter. I can't find definitions for these macros anywhere. I have tried to look into -> settings -> advance search -> macros, but these are not listed there.
Can somebody help ?
If you have access to the host(s) Splunk's running on, you can find the definitions in $SPLUNK_HOME$/etc/*/macros.conf
If you don't have that access, then it's possible you don't have permissions to see the definitions of those macros
However, you can always use the Job Inspector to see how Splunk translates what you type into what it runs
If you have the query in a search window then click on the query and type Shift-CTRL-E to have Splunk expand all of the macros for you.
I can tell you the drop_dm_object_name macro is just rename $1.* as *. The other macros are specific to their app.

Dialog box appear

I'm using decode for my query but when every time I run my query, there's a two dialog box appeared and need to input some number in those dialog box before to see the result. What should I need to remove it?
Please help me.
Thank you.
Here's some of my query..
SELECT (CODE_SALESROOM) POS_ID
,DECODE(CODE_SALESROOM, '60001', 'ABM SYSTEM'
,'50001', 'Acenet Unlimited Business Computer'
,'40002', 'RL My Phone - Robinsons Galleria') AS POS_NAME
FROM OWNER_DWH.DC_SALESROOM
WHERE CODE_SALESROOM NOT IN ('XAP', 'XNA', '10001')
Sounds like you're being prompted for substitution variables, because part of your query has somethling like and col = 'AT&T' - the ampersand is interpreted as a variable by default, and you're prompted for a value for &T (or whataver your actual value is interpreted as).
You can add set define off to your script to stop it looking for, and prompting for, a value when that is not what you want.
(The links are for SQL*Plus documentation, but much of that applies to SQL Developer as well; the documentation for that is a bit sparser),

Can the user be forced to enter a non-initial value by the Table Maintenance screen in SM30?

I'd like to force the user to chose between Yes and No, and not let him add an entry where the value is initial.
This is regardless of whether I check the Initial checkbox in the table definition.
Can this be done?
Domain data type : CHAR, 1 character, no conversion routine.
Value range: single values:
'1' description = 'Yes'
'2' description = 'No'
By far the easiest way is to use a data element in the table that only allows non-initial values.
If you can't change the data element, you can try using table maintenance events in the table maintenance generator:
You may be able to use event 1 (Before save) or event 5 to build a manual check, but 5 does not kick off on change.
If that doesn't work, you can still manually add a check in the PAI of the screen, however you run the risk that if someone regenerates the maintenance scree, they will forget/not know to put the check back in.
You can set the compare flag:
But from what I've seen the flag doesn't actually force you to redo any of the changes, and is still pretty easy to miss.
You can edit the screen and set the field to mandatory. Be aware that you will loose the change if the screen is re-generated.
You can do that with that steps:
in SE11 choose the Utilities menu -> Table Maintenance Generator
in the Table Maintenance Generator go to menu Environment -> Modification -> Maintenance Screens, then select the screen (usually is 0001), in the Element List Tab you find the Special attr, in the field Input, you choose Required for the field you want obligatory.
Thanks.
Regards.
Gil Mota.

What are the Aweber API Variables $account_id and $list_id?

You can check here:
https://labs.aweber.com/docs/code_samples/subs/create
The script to add a new subscriber to the list via api requires those two pieces info...only I cannot figure out for the life of me what those two variables are!! I've beaten through every little aspect of my Aweber Subscriber Account, AND my Aweber Labs account...and I can't find any reference to either of those variables anywhere. I've submitted some tickets to them, and haven't gotten any response yet.
Does anyone have any ideas here? I've tried my account names, my list names, to no avail!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, I've got it! You can get the values of both of these variables by dumping some other variables in the aweber api after making certain api calls.
get the account id first:
$account = $aweber->getAccount($accessKey, $accessSecret);
then vardump or print_r $account.
next we get the list id:
$account = $aweber->getAccount($accessKey, $accessSecret);
$list_url = 'https://api.aweber.com/1.0/accounts/<id>/lists';
$lists = $account->loadFromUrl($list_url);
then vardump or print_r $lists.
And you are all set! I'm so happy I figured this out, it freakin took long enough. Hopefully this saves some one a bit of time.
I too have agonized over finding the $list_ID, so went to deactivate the list, and create a new one, and "discovered" that if you hover over the Deactivate button, you get a url you can copy, and this gives both %account and %list Ids
https://www.aweber.com/users/lists/deactivate/$accountID/$lisID
like this....
https://www.aweber.com/users/lists/deactivate/123456/123456
Hopefully this will help make someone as it is a super easy solution
The proper answer is Anne Allen's one, but...
Check the return of the /accounts endpoint. It should return the same account id as you detected in the link, but I had cases they were different (strange, isn't it?). Use the account id returned by the /accounts endpoint and other endpoints to retrieve lists, subscribers, etc. will start to work. It's like if some accounts have two ids, one partially works and the other fully works.
Let me tell you how to get $list_id value... login into your AWeber account and then create a new list copy only integer value from list's name.
At first, login.
1) click Reports>Settings. Your account ID will be displayed in the box,example: ?id=XXXXX
2) click List Options>List Settings. There you will see the list ID under the name.
p.s. To add subscriber, you can use this - Automatically add into aweber list

Drupal Views - Custom / Modded SQL

I am having an issue with the "Profile Checkboxes" module which stores custom profile fields comma separated.
The issue is if I create a view to filter by a value. The SQL result ends up being something like this:
...AND (profile_values_profile_interests.value in ('Business and Investment'))...
Which will not return any data since the value is stored like this:
"Business and Investment, Case Law, Labor Law, Tax Law"
I just need to adjust the SQL so that it is making sure the field contains the selected value
Is there anything I can do to adjust this?
For a 'quick hack' solution, you could try implementing hook_views_query_alter(&$view, &$query) in a custom module, check $view->name (and eventually also $view->current_display) to ensure you are dealing with the right view/display, and then manipulate $query as needed.
EDIT: Looks like the underlying problem has been addressed by the module maintainer in the meantime - see John's answer ...
I'm the creator and maintainer of Profile Checkboxes and thought you might be interested to know that the new version of the module now stores the values as serialized and includes Views support. The feature is available in the current release version.
Check out the Views modify query module.