Ribbon Workbench display rule-How should a bool value be used? - microsoft-dynamics

I am trying to display a button based on a yes/no value. I am using a value rule and have tried 0 and 1, true and false, and InvertResult of nothing.
Does anyone know what the correct value is for assessing a bool? The button should display when the value is true (or not false).
Here is the xml produced and screenshot.
<ValueRule Field="cc_cancloseaswon" Value="Yes" Default="false" InvertResult="false" />
EDIT
The use case is as follows. I have a bool column on the entity to indicate if the button should be visible.
When the correct stage of the BPF in entered, a workflow sets the value to true.
When other stages are entered in the BPF, a workflow sets the value to false:
I believe it would set the correct visibility when the value is true.
The command checker shows it evaluates as false on top of not being visible.
Level up shows the value is true:
I have refreshed to check it has evaluated when the value is definitely set.

When comparing a ValueRule use 0 or 1 as values. Example:
<DisplayRule Id="YourDisplayRuleId">
<ValueRule Field="cc_cancloseaswon" Value="1" />
</DisplayRule>
Also see this article.
Keep in mind in many cases you may need an enable rule instead of a "display rule". Since MS Dynamics 2013 both types of rules hide and show buttons. The main difference is that display rules are evaluated server-side, while enable rules are evaluated client-side. When you need to hide or show buttons as a result of the user's actions on the form, you need to use enable rules, e.g. a CustomRule calling a JavaScript function on the form returning a boolean value.
Be aware, after your ribbondiffxml has been imported and published your browser may keep the previous definition in its cache for some time, even after a page refresh.

The display rule only evaluates attributes available on the form. true is the correct value for a bool, I just needed to add the attribute to the form.
I assumed it would assess non-table data but the ribbon seems to use formContext.data.entity attributes. This only occurred to me when I started writing a custom rule and it was an easy idea to test. The attribute can of course be hidden on the form if it doesn't otherwise need to be there.
If the attribute is not present on the form, it will evaluate as an empty string ''.

Related

Oracle APEX - make a field conditionally required

I have an item that is displayed conditionally - based on another item selection. I want to make that item non-required when hidden. What is the best way to do that?
As you have probably found, you cannot just set the dependent item's Required attribute, as this makes it required even when hidden. Instead you can create a Validation of type "Item is NOT NULL" on the dependent item, but with a server-side condition based on the value of the other item.
For example, suppose the first item is P12_JOB and the second is P12_COMMISSION, and P12_COMMISSION is only shown when P12_JOB = 'SALESMAN'. Then this Validation will do it:
As you can see there are various settings available there that you should check are appropriate for you e.g. Always Execute, Display Location.

Oracle Apex dynamic action not firing on true condition

I have a page with two Interactive Grids. One shows Approved records. One shows Unapproved records. There is a button with processing underneath on each grid to set the selected rows to Approved/Unapproved respectively.
I want to hide these buttons based on if a user is an Approver. These values are store in some user managed tables.
I have a dynamic action on Page Load that runs the following and sets a page item to 1 / null depending on the return:
select 1 from users where upper(username) = upper(:APP_USER) and userrole = 'APPROVER';
Based on the value in the page item two dynamic actions fire on page load to set the buttons with
True=Show
False=Hide.
Client Side Condition: Item = Value: P1_PAGE_ITEM = 1
Now - on my local machine this works fine. I made the page item visible. Can see a 1 or null and the buttons are hidden/shown.
I moved this to a Development environment and now I get a warning about Unsaved Changes each time I click out of the page (doesn't happen on Local). And although I can see a 1 in the Page Item field the actions see this as False (I put an alert on to fire when true/false).
Question is: Why am I getting the unsaved changes warning on the new environment. And why would the actions see the field as FAlse.
I have compared all of the properties as best as I can and they seem identical. I have even arranged the sequence numbers to be identical in the two environments.
All thoughts welcome...
This doesn't need to be a DA that is modifying a field value, hence the alert.
Why not define a computation that executes during the render, and use that as a server side condition on your Dynamic Action?
Otherwise you've enabled a security threat, where the user can tweak some HTML to see the regions you've hidden.

Updating values, one control to another

History, I am an experienced PL/SQL dev learning to use Apex and struggling with some of the concepts. Before working with PL/SQL I worked with various platforms including Delphi and VB.
Problem, how to pick up the value set in component from another component. The object of the exercise is to make the report in an interactive grid change dependant on a value selected in a drop down, the value in the drop down being in the where clause as a bind var. My original setup for this did not work. After various experiments with this I produced this test case where the object is for the label to display the value selected in the drop down:-
Page view
P300_SELECT (left) is a simple drop down, unmodified with the default values. P300_SELECTED_VALUE is a label set to display the value in P300_SELECT:-
Component setup
This does not work! And it continues not to work when I change the source setup of the label to be STATIC VALUE and set the value to &P300_SELECT.
I have also tried adding a CHANGE dynamic action on the drop down to call refresh on the label, it still does not work! In desperation to confirm that the value was indeed changing for the drop down I added a second true action to the change event executing the following javascript:
apex.message.alert($v("P300_SELECT"));
Sure enough, this works showing that the event is firing and that the value is correct:-
Label no change, but alert message works...
SO WHAT IS HAPPENING?
Why does the label not update even with a refresh called on it?
What do I have to do to make this work?
Thanks in advance for your help!
Bob
To do this
1 - Create one dynamic action to start when you change the value of P300_SELECT.
2 - Now there is a lot of ways to do this step, but I will sugest to do in this way. Create one true action in this dynamic action, this true action is "Execute PL/SQL code". The code is:
BEGIN
:P300_SELECTED_VALUE := :P300_SELECT;
END
In this true action put the item P300_SELECT in the field "Items to submit". And the item P300_SELECTED_VALUE in "Items to Return".
3 - Now create one more true action in this same dynamic action. This true action is "Refresh" and select the region of your report/IG.
***If the item P300_SELECTED_VALUE is just to test, so discard the first true action above and fill the field next of your select statement "Page items to submit" with the item P300_SELECT.
Why what you have try don't work?
1 - The source section is used to set the value when the page is loaded, this setup not affect changes after the page is loaded.
2 - The report is not refreshed because the item is not in the session after you change it.
Ex. https://apex.oracle.com/pls/apex/f?p=145797:15
Use this workspace to check something:
workspace: STACKQUESTIONS
user: test
password: test
app: 145797
page: 15
login on: https://apex.oracle.com/pls/apex/f?p=4550

Lotus Notes: refresh form from field

I have an editable field. Another computed field value depends from the value of the editable field.
In the Exiting event of the editable field I add:
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument
Call uidoc.Refresh
But it still not works. If I check the form property Automatically refresh fields, it goes OK, but the form performance decreases, it is very slow.
Any suggestions? Thanks!
Lotus Notes always computes the whole form from left to right and from top to bottom.
If a computed field is above the field, that triggers the refresh, then it does not have access to the "new" values of the editable field on the first refresh.
You would need 2x Call uidoc.refresh to make the computed field reflect the changes.
Or you move the computed field BELOW the editable field, then one single refresh will be sufficient.
Alternatively you may choose to use the onBlur- Event instead of the exiting- event as the "on"- Events were meant to replace the "Classic" Field events since version 6 of Lotus Domino / Notes. Check this link to Designer Help to see hints like
The corresponding LotusScript-only events still occur, but their continued use in Release 6 applications is discouraged.
onBlur: New for LotusScript with Release 6 and
Exiting: Preferred is onBlur
in the editable field's event "OnBlur" , switch to Client/LotusScript) and only add :
notesuiuiworkspace.CurrentDocument.Refresh
Don't forget to remove the one in exiting.

Sitecore values -- Template > Standard Values > Branch > Item

OK, here's the process I took...
create a new template "Mail Message"
create a "__Standard Values" item for the template
edit the "Subject" field in the standard values item: "Monthly email newsletter"
create a branch for the template
do NOT set the Subject field in the branch item
create an item from the branch
I would expect the subject would be the one from the standard values item, however it seems the branch field value is blank, and in turn the created item also has a blank subject field.
Should the Branch field value be that of the standard value. Or does the very act of creating a branch item eliminate any standard values you set.
Does the field versioing have any effect (e.g. Shared, Unversioned)?
I haven't been a big user of Branches, so I am surprised at the behaviour, but if it is normal, all good. Just want to confirm.
Alternatively, if the template or standard values were locked when the branch or item was created, the standard values might not have carried through.
Either way, you need to reset the value of the sitecore item. On the item, click the 'Reset' button, which is under the Versions tab and check the checkbox next to 'Subject'. Now, the field will show as 'Subject [standard value]'.
Hope that helps!
Creating the branch for the item template should copy the standard values and allow you to update the default values from the template.
So for example if you had "Monthly email newsletter" in the "Subject" field of the template it would be the same in the branch and all items created from that item.
Changing that field in the Standard Values should then update it in the branches and items.
If you have changed the field on the item however the link would be broken and you would no longer manage it from the standard values with out resetting the values.
Not sure on the shared/unversioned factor but dont think it effects the standard values.
When you change the value in branch template, you've broken the link already. So after that if you change the standard value, the value in branch template will not effect