Power apps set button visible if user email is the same as requestors email - email

I have a form request and i want to let someone edit only his own request except from me and my team that we can always edit. So I need to set edit button visible only for my team and the original creator of the form. I used the user.email to get the email of the user who uses the app but I cant use equality netween this variable and the data card value as its incompatible user type. Text with table. How can i get the email in the data card and compare it to the users email?

actually it's quite easy, your requestorEmail should be coming from some datasource like sharepoint record or datavererse or so on.
You can get current record and then it's property requestorEmail convert it to Text using Text function.
you could also try ThisItem.requestorEmail and with text function you can do so.
Ms Docs should help
In addition if you could show/add code for your requestorEmail data card, I can try to provide exact function to extract email. but above info should lead you in correct direciton

I used on change action of the datacard and used set global variable varUserEmail to thisitem.requestoremail . Then i set the button visible if the user email = varUserEmail.Email . So in this way everytime the email changes to the email that is supposed to edit the request the buttons are visible for editing or deleting the report.

Related

How to populate fields of an online form

I created a custom record (child of Inventory item) and an online form.
The final goal it's to send a link to a user (not a netsuite user) to display the different informations of this custom record. The user will be able to update some values and submit the form.
I saw it's possible to link a script file to this form, but I need the ID of the record to load it and populate every field of the form.
With normal forms, we have the internalid of the record as an URL param but in this case there is nothing in the URL .
Do you know any way to achieve that ?
A solution for the final goal could be:
Create an empty Suitelet (provides external link for User). Or refer to step 4 for contents.
Stored on the Custom record or via script (created in step 3) you can add to the external link, to include the record type and id as url parameters (&recordtype=customrecord&recid=12345). Be sure to avoid reserved parameter names.
Create a UserEvent, Client, or Scheduled Script to send email to User based on your requirements (in the email include the custom external suitelet link). User will click on the link and land on a NetSuite looking webpage (not requiring credentials).
Modify empty Suitelet. Suitelet should when context.request.method===GET: get parameters, load record(s), get data from record(s), create form, display data to User, display fields for User to enter data, add submit and refresh/cancel button, write/display the form with all fields. Upon submission (when context.request.method is not GET) you can use record.submit method to update the custom record(s).
NetSuite Suite Answer Id 74607 has a Sample Custom Form Suitelet Script from that can be very helpful.

PowerApps Modify Email-Screen Template

Hi I have a PowerApp connected to Sharepoint List. The sharepoint list has 2 to columns that are lookup values of peson/group. Please see screenshot of powerapp display screen below.
As I noted on the screenshot, I want have a button to send email. When the button is clicked, the email-screen template by PowerApps (Link) appears.
How do I autopopulate the Sponsor and BackUp Sponsor fields to the Email-Template, while still allowing the user to add more people if necessary?
I am not sure if this is needed but 
I don't think you will be able to add the people into that control, but you could create a label that shows the people from your form above the "To" field in the email form and let the user enter additional recipients into the To field.
The icon that triggers the sending of the mail has underlying code in the OnSelect property. The first command in there sets the variable _emailRecipientString by concatenating several strings.
Set( _emailRecipientString, Concat(MyPeople, Mail & ";") );
Add your list of people as parameters inside the Concat() function.
I also posted the answer here
here is the answer:
Add the code to the Notify/Send Email in the Display Screen
ClearCollect(selecteduser,
ForAll(DataCardValue1.SelectedItems,Office365Users.SearchUser({searchTerm:Email})),
ForAll(DataCardValue2.SelectedItems,Office365Users.SearchUser({searchTerm:Email}))
);
Clear(MyPeople); ForAll(selecteduser,Collect(MyPeople,Value))
I hope this helps someone else

What is the best way to create a form with a confirmation page?

I would like to create the following form:
Step 1: The user enters his contact details.
Step 2: A confirmation page, where the user has the possibility to confirm or edit his entered data again (back to step 1)
The contact details are stored in an entity domain object. The properties have annotations for validation.
My problem:
When I pass the contact object to the confirmation page, I get the message
Could not serialize Domain Object Vendor\Extension\Domain\Model\Object. It is neither an Entity with identity properties set, nor a Value Object.
I understand that I cannot pass a non-persistent domain object. A tip I found was to convert the object to an array and back again later. This works to display the input on the confirmation page. But if the user edits the data, I lose the validation functionality when converting to an array.
Another possibility would be to persist the object already after step 1 (temporarily?) . The problem here is that the data must not be displayed in the backend (they are not yet confirmed). In addition, unused data is created if the user cancels the process.
Is it possible to save objects temporarily?
What is the most elegant solution to this problem?
If you only wan't to create a form, why don't you use a form plugin like Ext:form or Ext:powermail? These have a summary page by default. And you have the possibility to write the entered data into you're database.

Using same id (not active one)

I've got an issue with a button.
I've got clients, and these all have a number ( Clients:: ClientID). Now I want to make a button in another form and send the active clientID to another application which will use this clientID to display information in that application about that client.
Now I've made a button with the open URL which contains following code snippet:
"http://localhost:12345/showClientFile?clientid=" & Clients::ClientID
When I click the button in viewlayout, the application always (no matter which record I'm in) the same clientID and not the clientID from the record that I'm in. When I check the URL in the browser, it is also that same id constantly. Am I missing something?
If you're on a layout that isn't linked to the Clients table occurrence, then there must be a relationship from whichever TO your layout is linked to to the Clients table. Otherwise you wouldn't see any value for Clients::ClientID.
You say you want to send the "active clientID". How do you, or the system, know what the active clientID is? Is it stored in a global variable, as in $$_ACTIVE_CLIENT_ID, or perhaps a global field, Clients::g_active_client_id? When you can say to yourself, "When I want to know what the active client ID is, I look here," then you know what will need to be done to edit the URL calculation.
"http://localhost:12345/showClientFile?clientid=" & $$_ACTIVE_CLIENT_ID

Is it possible, in NetSuite, to workflow a button to create a new email with no set recipient

currently we have a custom record with a list/record field that links to an opportunity and i can create a button that creates new emails (via workflow) pulling recipient information from the contact on the opportunity record but what i want to know is if there is a way to replicate the "New Email" button usually found on a record's Mail Merge tab as i want to be able to press a button to open an email template that has no recipient set as currently the send email workflow option has both recipient and sender as mandatory fields - is this possible?
You can edit the Custom Record Type to check the 'Enable Mail Merge' checkbox, then you should have this functionality.
If you want the functionality to be available via a button in the main button group, I don't believe this is possible using a workflow only; however you can achieve this with scripting. To do this, create a User Event script with a Before Load function to add the button to the form, and a Client Script which can be called on clicking the button. Upload and deploy to the Custom Record Type that you want the email button to appear on. For this answer I'll assume you have at least a basic knowledge of creating a script record - let me know if you need more information.
The User Event script:
function emailButton(type, form)
{
//add a custom button on the form
//specify the function name of the Client script created in Step 2
form.addButton('custpage_Add', 'Start Email','startEmail();');
//set the internal id of the Client script created in Step 2
form.setScript('customscript_ppcs_start_email_client');
}
The Client script:
function startEmail() {
new_message([['transaction',document.forms['main_form'].elements['id'].value],['entity',document.forms['main_form'].elements['companyid'].value],['template',['66']]], 'EMAIL');
}
You can modify the template used by replacing the '66' with the internal ID of the template you want, or you can remove it. You can also remove the 'entity' as you don't want the recipient to be set. Below is an example with both removed:
function startEmail() {
new_message([['transaction',document.forms['main_form'].elements['id'].value]], 'EMAIL');
}