Image visible according to query boolean in Access 2013 Form - ms-access-2013

Hy,
I'm on Access 2013 Form.
I would like to show and hide this image according to the value of a boolean (ET1_EDD) coming from a sql query.
I checked, the value of this boolean is correctly returned on my form, but I think that I can not write my condition correctly.
I try
=VraiFaux([ET1_EDD]=Faux;[Bnt_UnValid_EDD].[Visible]=Vrai;[Bnt_UnValid_EDD].[Visible]=Faux)
or
=[Bnt_UnValid_EDD].[Visible]=VraiFaux([ET1_EDD]=Faux;Vrai;Faux)
And I tried with 'True' or 'False' / 1 or 0 / 'Vrai' or 'Faux' ... same result, it does not work
Someone would have any idea?

Related

Don't load table on first load Oracle ADF

Everytime my page comes up it executes the table query. I tried doing this,
https://blogs.oracle.com/shay/entry/preventing_queries_when_page_f
but it still happens. How can I fix this? I've tried setting the refresh condition to never, but then I can't get any data back. I'm using JDev 11g.
Thanks.
I can share how I did this in JDeveloper 12.1. I am not sure whether it works in 11g. Nor am I sure it's the best way to do it. But it worked for me.
The idea is to not prevent the initial query execution, but, rather, to make sure it happens quickly and returns no data. The approach is to set the initial query criteria in the View Instance of your Application Module.
This approach assumes you have at least one bind variable in your view object. If you do not, you will need to add one just for this.
Double click on the Application Module
Click on the "Overview" tab at the bottom
Click on the "Data Model" tab on the left, so that you are viewing the Data Model Components of your Application Module
In the "Data Model" tree on the right, click once on the View Object Usage ("MyObjectVO1", e.g.).
Click the "Edit..." in the upper-right corner of the Data Model tree.
Here, you can specify view criteria to be used initially for the page. So,
* Set an initial parameter that will (A) execute quickly and (B) return no data
Then, later, programatically reset the bind variables to correct values that will return data, when you are ready to let your query run.
The most simple way i know is to set up correctly "Refresh" attribute on iterator in the page definition.
To do that set refresh=ifNeeded, then set RefreshCondition with expression language, something like this: #{viewScope.yourBean.refresh}
public class YourBeanClass {
private boolean refresh = false;
public void someAction(ActionEvent actionEvent) {
//some custom logic to set refresh flag
refresh = true;
}
public boolean isRefresh() {
return refresh();
}
}
With this code you can simply manage the moment when you need to refresh your model.
While these solutions will work to prevent the query from executing, I would ask what is the use case that a user sees a table appear on a web page without doing a search first?
ADF is built to query automatically because normally a web page will have an af:query or af:quickquery component on the page to allow the user to enter a query. Once the query is executed, the results are returned and populate the table or form (depending on the page design). Including either of these search components on the page will prevent the page from executing the query until the search is executed. You can also execute a query on entry to the page using a taskflow and adding an Execute operation from the data control to the navigation into/prior to getting to the page.
Note that Shay's blog post is from 2009 and covers the use case of not using a search component and instead uses Execute with Params. Is this what you are using? Saying more about your use case would be helpful.

Sitecore Query returns null when using attributes

We have a sitecore support ticket open for this issue, but I hope I could get someone else that's experienced this issue also.
Here is the output from my immediate window while debugging my sitecore 6.6 instance:
?db.SelectSingleItem("/sitecore/content/Www/Data/Recruiting/Metadata/Companies/00000001/*[##name='0000001873']")
null
?db.SelectSingleItem("/sitecore/content/Www/Data/Recruiting/Metadata/Companies/00000001/*")
0000001873 (en#1#web), id: {1848E256-E7C2-4BFC-9AF7-72EE14E37C82}
Database: "web"
Id: "{1848E256-E7C2-4BFC-9AF7-72EE14E37C82}"
Language: "en"
Name: "0000001873"
Version: "1"
Basically when I run either SelectSingleItem or GetItem and include any attribute (##id or ##name), I get null returned. However, if I remove the filtering attribute I do get a result set. Notice that the result set I get without the filter, is the first item in the list, is also the item I'm searching for with the ##name attribute.
I get this result ONLY in code. Using xPath designer I get a result.
I encountered a similar issue and it ended up being a folder whose name started with the number zero. I chalked it up as a potential issue with the way Sitecore parses queries and didn't look into it much further. Try escaping the folder name like so:
/sitecore/content/Www/Data/Recruiting/Metadata/Companies/#00000001#/*[##name='0000001873']

apex retrieve default item value

Is it possible to get default item value using plsql? I have a validation and in case it fails I want to reset item to its default value.
I tried using apex_util.set_session_state('P_ITEM_NAME', null) but that did not have any noticeable effect.
How can default item be retrieved or item itself be reset?
When creating a page process, there is a condition called "Inline validation errors displayed", maybe this will help? In this process you can reset items to null, then when page loads, item values will return to their default values.
UPD:
Create process:
Process Point: On Load Before header
Condition: Inline Validation Errors Displayed
Process source:
begin
for i in (
select t.ITEM_DEFAULT, t.item_name
from apex_application_page_items t
where t.application_id = :APP_ID
and t.page_id = :APP_PAGE_ID
) loop
apex_util.set_session_state(i.item_name, i.item_default);
end loop;
end;
This will return all page items to their default values.
This solution some ugly, but i don't know another solution for this problem.
:P_ITEM_NAME := null;
The difference here is the ":" infront of the item. Using it like this will give access to the item. Using apostrophes isn't needed I believe.
If this doesn't work with your version try without the ;.
So you can use:
:P_ITEM_NAME
To get the value.
I could not find any function that would return me default value using an item. However I could use default item setting to mimic this. Page processes do not run when page has validation errors, so I added conditional page process that performs the same checks as my validation and when these checks indicate that validation fails it just clears item state.
This is ugly as it requires checks to be duplicated and it seems that it is necessary to replicate almost same page controls through all pages where such reset mechanism is necessary.

sfWidgetFormInputCheckbox do not work properly

I have a problem with a sfWidgetFormInputCheckbox. It do not save false in the database when the checkbox is unchecked.
In my schame my field is a boolean, and i don't have bug in the value displayed.
Set the default value like this : $this->setDefault('status', false); don't work either.
My widget :
$this->widgetSchema['SUSPENSION_TEMP'] = new sfWidgetFormInputCheckbox();
$this->validatorSchema['SUSPENSION_TEMP'] = new sfValidatorBoolean(array('required' => false));
The default :
$this->setDefault('SUSPENSION_TEMP', false);
Any ideas ?
Edit:
It save 1 when the checkbox is checked. And do not change the database value when you unchecked and save. So once you checked once, value is always 1 in database (true for my code).
Edit2:
I have two clues to add. If the field is an integer in the schema.xml, both values work, bu we got a poblem on value displayed (checkbox checked qih the 0 value). Here, he field is a boolean.
The setter receive two kinds of value, 'on' when checkbox is checked and true when it's not. I tried to set default value to false in form, and to overide he setter. Both don't work.
I mean the setter work, but for an unknown reason the basic seer is called right after with a wrong value.
Edit3:
Ok, i understand part of the problem. The setter is not called, when the checkbox is unchecked. I thought it was because, m code displayed a var_dump(). It was because later i copy the old version of this object in archive purpose.
But symfony should detect that the field has been rendered and it doesn't. I don't know why. I know why in html, but obviously symfony should be able to tell himself "hey, i add a checkbox here".
Is there an elegant way o do this, or should i checked it by hand ?
The problem came from my form handling. My legacy code, did no render all fields (ex : some stamp field, updated by a behavior). It was using fromArray, then save. This update only the fiels rendered.
The traditionnal symfony form, give null to all non-rendered fiels in order to chcuk for required validation.
So you need to check by yourself and set to 0, when you are using a fromArray then save. Still, i find the form->save really dumb, because you need to send useless(in this case) or confidentials data to your client in order to use it.

MS CRM QueryExpression ConditionExpression w/ CRMBoolean type

I'm using Microsoft's CRM software (4.0) and I'm trying to build a query expression. It works fine with querying only String values, but now I need to include a field that is of type CRMBoolean. I should also mention I'm querying custom entities.
So previously, in my query I would only search by a few fields, but they were all of type String. Now I need to add another ConditionExpression for a CRMBoolean. The type of custom entity I'm searching for has a field called "Condition" - which will either have a value of "true" or "false". In CRM the attribute is defined as a bit, but I didn't think that would make a difference.
Here is my code I'm trying to use to find records that have a condition of "true":
oCondition = New ConditionExpression()
oCondition.AttributeName = "myEntity_condition"
oCondition.Operator = ConditionOperator.Like
Dim bool As New CrmBoolean
bool.Value = True
oCondition.Values = New Object() {bool}
listConditions.Add(oCondition)
I don't get an error, but nothing really happens. The number of records that is returned never changes one way or another. Has anyone done this before?
Thanks in advance!
Instead of putting a CrmBoolean object in the oCondition.Values array, just put a regular true/false boolean. I would also concur with benjynito on changing it to ConditionOperator.Equals instead of Like.
I don't know how the like operator is suppose to behave on a boolean. I wonder if its being ignored. Try ConditionOperator.Equal.

Resources