Microsoft Project Siena - How to make button1 navigate to a certain page if text1 equals "XX"? - project-siena

Microsoft Project Siena - How to make button1 navigate to a certain page if text1 equals "XX"?
Hello everyone,
So what I want is when you click a 'button' it will navigate to a page where you can enter in a password aka text in (for example the 'text1' field) then on the same page will be a 'button', when you click the 'button' it will check to see if there is certain text in 'text1' and if the text matches it will navigate to whatever page I want it to.
Is any of this possible?
If so, how exactly?
Keep in mind I would like to do this while inside of 'Microsoft Project Siena' meaning I do not have any other 'app' making tools installed currently.
Thank you and kinds regards,
-Sean D.
::UPDATE::
Some things I have already tried on my own:
I have another button that changes the visibility to true once a timer equals 5000, so I tried the same type of thing but it doesn't seem to be changing the visibility when the correct text is entered, for example:
If(Text1!Text!Value=test1234, true)
not even this works:
If(Text1!Value=test1234, true)
That is what I have in the visibility formula, but like I said it doesn't work.
But yet when this is used with a timer like so:
If(Timer1_1!Value=5000, true)
After you navigate to the page and 5 seconds later the button appears and it works great.
Any ideas?

I figured it out:
If(Text1!Text="test1234", true)
did the job!
-Sean
Also if you want to clear out the password "InputText" then you'll have to do something like this:
Navigate(Screen1, ScreenTransition!Fade);UpdateContext({text_pwd: "abc"});UpdateContext({text_pwd: ""})
Put that on the button for navigate and it will navigate to the "Screen1" and clear out the password text, then change the Default property of the password "InputText" to text_pwd or what ever you would like to name it.
Goodluck!
-Sean

Related

How to get the text of a menu item with its ID

I have an old visual prolog project in which I have to change the text of a menu during runtime.
This is what I've done to change the text:
menu_setText(Win, id_menu, NewMenuText)
This works fine, however, when I want to enable/disable this menu, the following does not work (meaning the menu item doesn't change its state):
menu_Enable(Win, id_menu, b_true)
After some search, I found that:
Under MS-Windows, submenus can not be referred to by a resource identifier. If the menu entry for a submenu, needs to enabled, disabled, checked or have the text changed. it is necessary to use a special versions of the menu_Enable, menu_Check and menu_SetText predicates, which specify the text of the menu entry instead of the constant.
menu_Enable(WinHandle, String, BOOLEAN)
menu_Check(WinHandle, String, BOOLEAN)
menu_SetText(WinHandle, String, NewString)
The weird thing is that in my case, menu_setText works just fine with the constant where menu_Enable requires the text itself. (yes I tested menu_Enable with the initial text of the menu item, but when the text changes then everything breaks)
Here comes my question:
How can I enable/disable a menu when I know its ID but not its name ?
If not possible directly, how can I get the current name of a menu when I know its ID ?
In case this helps, this project is opened and compiled with VIP52 (since before the year 2001).
I finally found a workaround that solves my problem, but I'm still not really satisfied, so if anyone comes up with a better answer, I'll take it !
I declared:
txt_menu(menu_tag,string)
And then called:
txt_menu(id_menu, MenuText),
menu_setText(Win, MenuText, NewText),
retractAll(txt_menu(id_menu,_)),
assert(txt_menu(id_menu,NewText)),
menu_Update(Win)
whenever I have to change the text of a menu item, and this can easily be transformed into a menu_setTextById predicate as such:
menu_setTextById(Win, MenuId, NewText):-
txt_menu(MenuId, MenuText),
menu_setText(Win, MenuText, NewText),
retractAll(txt_menu(MenuId,_)),
assert(txt_menu(MenuId, NewText)),
menu_Update(Win).
with the usage:
menu_setTextById(Win, id_menu, "My new text menu").
Noted that if I ever have the need to have several windows with menus, I'll have to add the Window Id to my txt_menu clause.
The main problem with this workaround is that I can't use & in the new text menu because if my menu has "&Menu" as text (meaning that M will be underlined), then trying to use menu_setText(Win,"&Menu","New Menu") will break because "&Menu" is not found.
So I'd need to remove any ampersand from the string before trying to use it in such predicates.

How to create a NotesRichtext item that is computed for display?

I know this is a common problem, and I tried a few solutions already, but the problem I have right now with my current code is that even though the attachments show in the computed for display field, I get the error "Note Item not Found" when I try to open them.
The form is built with two fields, in a programmable table that displays the editable one or the computed for display one.
The trick I found with Google's help was to delete the computed for display item in the queryopen event, so Notes regenerates the cfd item when opening the document. Visually, this works, as I see the text and attachments, but the attachments can't be opened.
Here is the code that removes the item in the QueryOpen of the form:
...
Set item = doc.GetFirstItem("dspDescription")
If Not item Is Nothing Then Call item.Remove()
...
Has anyone successfully achieved that functionality? Is there another way of doing this? I already tried with subforms, and because of the way the application is built, I need to be able to switch from editable to read only on the flick of a radio button, so subforms are out of the question as they can't be displayed dynamically.
Why don't you simple put the richtext item in a controlled access section and make that section editable / not editable with a computed for display formula. Select "always expand" and hide the section title, so that nobody can collapse it, et voila.
Regarding your comment: With this properties:
for this section in designer:
You get this result:
You see: No twisty, no "visible" section

hardcoded string “Button”, should use #string resource

I am new in Android app development and using Java language.
My problem is every time I make a TextView or Button there is a triangle with the exclamation mark below them.
and when I click it I saw a message saying:
hardcoded string “Button”, should use #string resource
I have two activities, in my main activity there is a Button that when you click it you will go in second activity.
But when I go to my main.java to make a code for the button. There's always the above shown error. I think the eclipse can't find the id of my button and same for my TextView they have same error message.
Here is the code I made:
Button b = FindViewById(R.id.button1);
I also add:
Button b = (Button) FindViewById(R.id.button1);
I am using the latest eclipse classic and ADT august issue. The platform is Android 4.1 API 16.
You shouldn't hardcode the "text" on the widgets use the strings resources ie., strings in the strings.xml to set the text. Declare the "text" you want to display as a string in strings.xml and access it using #string/your_string_name in the layout file.
Notice the id of the button, which is rounded in red. You have to use this id when you want to call it in a method, for an example
Button b = (Button) FindViewById(R.id.button1);
Furthermore, check whether your graphical layout matches with the image I have provided.
Just try your code again with these changes.
Your main.java would look like this.
I am a newbie too, but I believe I got this. So basically what's happening here, java wants you to put your hardcodes in string.xml. so that when accessing it, you will use the given methods below before:
.
But this is how it should be.
Let's start by string.xml
Then come back to your activity_main.xml

Hide CRM form left hand side navigation item

I have my account entity linked to a custom entity called inspections, I only want these inspections to be created for accounts of a certain type. So when it isn't that type I want the left hand navigation to this entity to be hidden away. I've seen some code that says will hide it away, as long as you have the navID of the item.
I've had a crack at hiding it using what i thought could be the ID but it hasn't worked, so I'm wondering if anyone knows how to get this ID, or if there is another way to do this?
The code I'm using to hide the navigation is below:
var navitem = Xrm.Page.ui.navigation.items.get("nav_ts_inspection");
if (navitem != null)
{
navitem.setVisible(false);
}
Load the form
Press F12 to show IE Developer's Toolbar
From here you can use CTRL+F to search for the display name of the item you'd like to hide. This will give you a link that is generated. The Id of this element is what you need to use to show/hide the link.
As an example, you can see results of searching for 'Sub Accounts' on the Account screen for an installation I am working on at the moment. The Id can be seen and is 'navSubAct'
Changes by traversing DOM and manually hide an area is not officially supported.
Luckily if you are on CRM 2011, you can go to
Settings > Customization Or open the solution.
Select the entity > Forms. Inside the Form editor window, open the Form Properties of the entity.
Go to Display Tab and untick "Show navigation items" checkbox.
Finally do not forget to Publish your changes.
Use the relationshipname to hide folder in navigation like this:
If you have folder with the relationship name: ts_inspection
Use this for ID: navts_inspection
So otherwise the same as above, but lose the extra underscore (_) between nav and ts.
var navitem = Xrm.Page.ui.navigation.items.get("navts_inspection");
If you want to hide particular navigation section from the FORM then remove all the links from that section and publish it. That section will not be visible anymore.
If you want to just remove Navigation Pane from FORM, then go to 'Display' tab of form and mark as 'Do Not Show' and then publish it.

<a4j:include> content doesn't get change

This is what i want to achieve. I have navigation panel on left and content panel on right.
when user click links on left navigation panel , ajax calls made and content panel got rendered. With current implementation, content got change based on the link i clicked.
however i found content still don't get change when perform following steps:
1. click "display user", user list got display
2. click "add user" to add one user
3. click "display user", user list got display but content is same as the one in step 1.
i am sure data has been inserted into db.
looks like this view got cached on server. is there anyway to solve this issue?
following are my code and screenshot.
thank you,
i found answer from this link.
basically, use following line to destroy backing-bean, then problem solved.
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove("wizardBean");
http://java.dzone.com/articles/jboss-richfaces-spring?page=0,6

Resources