I had a function in PowerApps:
SubmitForm(Form1) && SubmitForm(Form2),
ResetForm(Form1) && ResetForm(Form2),
Navigate(Screen4;Fade))
This function was on the button, and it was responsible for sending forms, resetting data and showing the "complete" window.
I would however want to change this function so it would work only if Form1 is not blank (form 1 is a sharepoint multitext field that is required).
I tried to do it like that:
If(
IsBlank(Form1),
DisplayMode.Disabled,
DisplayMode.Edit
else
SubmitForm(Form1) && SubmitForm(Form2);;
ResetForm(Form1) && ResetForm(Form2);;
Navigate(Screen4;Fade)
)
or like that:
If( ! IsBlank( Form1),
SubmitForm(Form1) && SubmitForm(Form2);;
ResetForm(Form1) && ResetForm(Form2);;
Navigate(Screen4;Fade))
but I am getting ParenClose...
Could you please help me in making it work? I would love to have button greyed out if the Form1 does not have at least 1 symbol.
Form 1 is a sharepoint multitext field that is required
The blank statement needs to evaluate the string inside the field so you would need Form1.text
IsBlank(Form1.text)
Related
We have a PowerApps form with several fields that must be completed before the form can be submitted to the Sharepoint List.
We can't make them required or mandatory on the Content-Type and List because we want the users to be able tosave their data, and come back to it to edit it before Submitting...
So we need to disable/hide the Submit button until these fields are completed by the user.
In our Submit Button control we are using a formula to control the Visibility property of the button, or it's container which is the footer.
So we have tried this kind of thing:
If(
And(
TitleField.Text <> "",DescOfInitiativeField.Text <> "", DateRaisedField.SelectedDate <> Date(
1900,
01,
01
),
Not IsEmpty(PersonalDataChoiceField.SelectedItems.Value),
Not IsEmpty(SpecialCatChoiceField.SelectedItems.Value),
Not IsEmpty(ChildrensDataChoiceField.SelectedItems.Value),
Not IsEmpty(CriminalChoiceDataField),
Not IsEmpty(SourcesOfDataChoiceField.SelectedItems.Value),
but we are not having any luck..
So what's the correct way to go about this? How can we test that at least one of the options in each of our combo-box fields is selected?
I don't know why you add .Value after .Selecteditems
If(IsEmpty(ComboBox.SelectedItems),false,true)
It returns false when nothing is selected
Try something like this in your Visible function of your button:
If(IsBlank(TitleField.Text) Or IsBlank(DescOfInitiativeField.Text)
Or DateRaisedField.SelectedDate = Date(1900,01,01)
Or IsEmpty(PersonalDataChoiceField.SelectedItems)
Or IsEmpty(SpecialCatChoiceField.SelectedItems)
Or IsEmpty(ChildrensDataChoiceField.SelectedItems)
Or IsBlank(CriminalChoiceDataField)
Or IsEmpty(SourcesOfDataChoiceField.SelectedItems), false, true)
I need to create a button in Lotus Notes mail stationary which will insert a text and then the button is deleted from the message.
In the button I have:
res := #Prompt([OkCancelList]; "Is it OK?"; "Select result"; " ";"OK":"Failed":"");
#If(res ="OK";
#Command([EditGotoField]; "Body") + #Command([EditInsertText]; "Everything is fine);
#Command([EditGotoField]; "Body") + #Command([EditInsertText]; "Not so good mate"));
This part works fine, but I am not sure how to delete the button after click. Usually works #Command([EditClear]) but not in this case when I use #Command([EditGoToField]) in the formula.
I suppose i need to use GoToField again with the correct button identifier and then run EditClear, but I do not know where to find it, or if there is another way to do it... Ideas?
Thank you.
Assuming you have the button in field Body and nothing else that have to remain
then change your code to:
#Command([EditGotoField]; "Body");
#Command([EditSelectAll]);
res := #Prompt([OkCancelList]; "Is it OK?"; "Select result"; " ";"OK":"Failed":"");
#If(res ="OK";
#Command([EditInsertText]; "Everything is fine");
#Command([EditInsertText]; "Not so good mate"));
It selects the content of Body (including button) and replaces it by the new text.
Assuming your document is (or could be put into) edit mode, you could still have the button, but have the button in it's own paragraph (or table cell) with a hide-when formula of of MySpecialButtonPressed!="", and then include the line
FIELD MySpecialButtonPressed := #Now;
in the button code.
(Edit: changed test from =1 to !="", then changed the set value from 1 to #Now because Notes doesn't store Boolean values. Unless you're sending out millions of these, the cost of using dates instead of numbers less than the benefit of having more specific information in case you need it.)
I did add a new menuitem to that hyperlink context menu. Now I need to find the hyperlink I right-clicked.
What I got is the whole email item from Office.IRibbonControl.Context, which is an Outlook.Explorer with one Selection. The selection turns out to be an OutlookItem.
It does have an email body. But I may have multiple hyperlinks in inside it. It must be a way to get the hyperlink because other menu items work: Open, Select, Copy Hyperlink.
Any ideas?
Sunday has passed, sorry. But I´ve had the same problem and found the following solution:
public void OnCustomHyperlinkMenuClick(IRibbonControl control)
{
Explorer explorer = control.Context as Explorer;
if (explorer != null)
{
Document document = explorer.ActiveInlineResponseWordEditor;
if (document != null && document.Windows != null && document.Windows.Count > 0)
{
Microsoft.Office.Interop.Word.Selection selection = document.Windows[1].Selection;
if (selection != null && selection.Hyperlinks != null && selection.Hyperlinks.Count > 0)
{
Hyperlink hyperlink = selection.Hyperlinks[1];
string hyperlinkUrl = hyperlink.Address;
DoSomethingWithUrl(hyperlinkUrl);
}
}
}
}
You will need to add a reference to the word interop assembly "Microsoft.Office.Interop.Word.dll" to your outlook add in project.
I am fairly new to Word Addin development. Fortunately I was able to do almost everything but stuck at some simple issue I belive.
I want to insert plain text controls dynamically at the selected range. For this I am using the following:
currentDocument = application.ActiveDocument;
foreach(var field in myFieldsList)
{
Microsoft.Office.Interop.Word.Range rng = currentDocument.ActiveWindow.Selection.Range;
object oRng = rng;
var contentControlPlain = application.ActiveDocument.ContentControls.Add(Microsoft.Office.Interop.Word.WdContentControlType.wdContentControlText, ref oRng);
contentControlPlain.Tag = formField.FormFieldId.ToString();
contentControlPlain.SetPlaceholderText(null, null, " <" + formField.FormFieldName + "> ");
contentControlPlain.LockContentControl = (formField.TypeName.Trim() == "Blank");
}
Code seems to be working fine but when I try to insert the second field it complains saying:
This method or property is not available because the current selection partially covers a plain text content control.
I understand that addin is trying to insert next content control into the previously inserted plain text control. But I tried giving some other range and could not fix it.
Any help is greatly appreciated.
Thanks.
After adding every content control use
Application.Selection.Start = lastControl.Range.End+1
Dim xbg As Rm
xbg.LobId = cmb_lob.SelectedValue
xbg.Mobile = mobno.Text
xbg.BusinessFax = faxno.Text
xbg.BusinessPhone = phno.Text
xbg.Save()
I have a combo box, which is not mandatory while input in the module. therefore user can select blank value in combo cox for which i want to save null in Oracle Database for that record. I had trid with following condition but fails to get result. you are requested to please help
if cmb_lob.selectedindex=-1 then
xbg.lob=dbnull
else
xbg.LobId = cmb_lob.SelectedValue
Actual Problem arises when first user save record with selection in Combo box then user edit that record and select blank from Combo box. now i have to replace value of combox box with null at database.
Set it to null or whatever VB considers null - it will be set in the DB that way.
try:
if cmb_lob.selectedindex <> -1 then
xbg.LobId = cmb_lob.SelectedValue
else
xbg.LobId = Nothing 'suggested by John Shean (see comments)
So that if the value is selected only then assign it to field else leave it as it is (null)
Try xbg.LobId = Nothing instead –
By John Sheehan