Button to send email in NetSuite workflow - task

I need help creating a "Submit Feedback" Button that essentially, would email the admin the text of the feedback the user submits. If I can do this with a workflow, I would prefer that. However, if we need to create a SuiteScript, that's OK.
I need to know how to get the button to stay on the task at all times so the user can always see it no matter what. Moreover, I then need to have the feedback sent to the admin via email. Thanks for the help everyone!

Workflow: Event Definition>On Create and On View or Update (to make sure the button always appears)
State 1: Action > Add Button (Trigger on Before Record Load)
State 2: Action > Send Email Transition: From > State 1, To > State 2, Execute On Button > Choose button created in State 1
Once you have set all the required fields for these steps, this should work. Let me know if you need anything clarified.

Related

Redirect to another page without confirmation

I have a textbox. I want to logout current page and session without any confirmation and redirect to Login page when user enter "exit" in the textbox. any solution?
Suppose that text item's name is P3_TEXT. Set its "Submit when Enter pressed" property to YES. Create a process whose PL/SQL code looks like this:
begin
if lower(:P3_TEXT) = 'exit' then
apex_authentication.logout(:SESSION, :APP_ID);
end if;
end;
Run the page; if you put "exit" into the text item and press Enter key, you'll be logged out.
[EDIT]
Previous Apex versions (3.1 for sure) had the APEX_CUSTOM_AUTH.LOGOUT procedure whose 3rd parameter was p_next_url you could have set to - for example - Login page. It is now deprecated (I believe you'll get the error if you try to use it).
Now (in the recent Apex version), navigate to application's Shared Components - Authentication Scheme. In there, you'll see the Post-Logout URL section which can be set to
Home page, or
URL
so - pick one that best suits your needs.

Filter out approved code reviews in gerrit

I have a few (~20) reviews in "Incoming reviews" section, and I would like to either move or filter out those that I did "Code-review" +2 or +1 myself. Preferably move to the other section "approved incoming reviews" or other comparable solution. Currently gerrit grays out subjects you approve, but it also grays out any other projects you post some comments. So it does not filter those efficiently, and you have to revisit every project. That is time waste.
I have tried to remove myself from the project after the approval, but such action removes approval as well.
Is it even possible?
A suggestion:
1) Click on YOUR-NAME > Settings
2) Click on Preferences
3) In My Menu add the following:
Name = Review (or other name you want)
URL = #/q/reviewer:self+status:open+label:Code-Review=0%2Cuser=self
4) Click on Save Changes
Now if you click on the new menu item: My > Review you will see all open changes you're a reviewer but don't have voted yet.

How do I conditionally select the next view controller to navigate to?

In my iOS app, I want the user to log in with facebook on page1, then get redirected to page2. On page2, there is a "Yes" and "No" button. Now, there are two scenarios:
1-If user pushes "No" he stays on page2. If he logs out from app and logs in back in future again, he again goes to page2 until he pushes "Yes" eventually.
2-User pushes "Yes" on page2. Now, he gets redirected to page3. From now on, every time user logs out and logs back in, he gets redirected to page3 directly without seeing page2. This is the part I am having trouble understanding how to implement in my code. Is there a way to initialize a global variable at start of my "ViewController.swift" code, but update its' value with a new value at the part of the code that takes care of actions if user pushes "Yes"? I mean is it possible to update the value of a variable from one thing to another at initialization?
Actually, maybe the shorter way to explain my question is: Could I initialize a variable in swift with some value at first, then, after user performs a specific action such a pushing a button, I change the initialization value permanently afterwards that action?
Also, please do let me know if you know any other ways to accomplish this.
Yes of course you can. I would say it's a user preference. Lucky, there is something called NSUserDefaults for that. It's a persistent storage so the value will stay here forever (until the app is uninstalled or rebuilt).
For example if user say yes on page 2 you write:
NSUserDefaults.standardUserDefaults().setBool(true, forKey: "usedSaidYes")
otherwise:
if NSUserDefaults.standardUserDefaults().boolForKey("usedSaidYes") == true {
// Redirect page 3
} else {
// Redirect page 2
}
You should check if this value exist before, if not you go on page 1

Why I can't touch the button in alert view, right after I see the alert?

I'm testing iOS application by using the automation framework named "Frank"
And there were some alert popped up in my application I need to cover.
I've wrote my feature file as below:
Scenario:
I input wrong username and password, I should see the log failed alert.
...
When I wait to see "Log failed"
Then I touch the button marked "OK"
Unfortunately, this code won't work, although frank(cucumber) will mark the test step of touch "OK" button as Pass, but actually, the button won't be touched.
I have to do it like this:
Scenario:
I input wrong username and password, I should see the log failed alert.
...
When I wait to see "Log failed"
#Wait for 1 sec in order to touch the button.
And I wait for 1 second
Then I touch the button marked "OK"
The comment above is probably correct - as for a different (better?) solution - depending on how comfortable you are with ruby, you could write your own step definition? Frank provides you the
Frank::Cucumber::WaitHelper.wait_until
method, which you could wrap around your touch the button code, to give you a longer implicit wait on the element. See here for some documentation: https://github.com/moredip/Frank/blob/master/gem/lib/frank-cucumber/wait_helper.rb

How do you test a submit button being disabled after clicking in capybara?

We are trying to disable a certain submit button after clicking on it. Something like this:
assert !page.has_css?("#review_button[disabled='disabled']")
click_button "Review"
assert page.has_css?("#review_button[disabled='disabled']")
The problem, of course, is that the form submits before the second assertion is checked. Is there any way to disable the actual submission of the form, or suspend it until after the second assertion is checked?
I remember having this same issue and never found a good way to do this, because as you said, it only gets to the next assert when the "Review" action completes.
What I ended up doing, considering that the action that the button did took a long time (and thus justifies having the button be disabled) is to make the action create a Delayed Job job and then let it run asynchronously. Then it's pretty easy to mock that out and make it sleep for a few seconds (or what have you) to check that the button is disabled.

Resources