"Permission Access on Suite-let External Link" - netsuite

How can I get access Suite-let externally without login into NETSUITE..
I am trying to get Employee record through suitelet but internally it is showing employee records but when I get external link it send me error message
"You do not have permission to access Employee data"
///Search for employee record////
var mySearch = search.create({
type: record.Type.EMPLOYEE,
columns: ['entityid','salutation','email','mobilephone'],
filters: [
['supervisor', 'is', 8316]
]
});

In the Script Deployment, change the value of Execute as Role to a role that has permission on Employees.

Related

Sequelize bulkCreate with associated model

I have two models Role and Permission. Upon creating Role record I need to create Permission record as well. My object structure is as follows
const rolesWithPermissions = {
name: 'role_name',
description: 'role_description',
permissions: [{
name: 'permission_name'
}]
}|
id in roles will be created by the database while inserting the record since its auto_increment.
role_id is the foreignKey in Permission model for Role'id column.
I have created Sequelize models for both Role and Permission and have setup the associations as well.
Now the problem is while creating roles I will be passing the permissions data as well.
It is successful but it is not populating the role_id in the Permission model.
Now how do to make this creation successful, I will not be able to pass in the role_id while creating the permissions object since I want to create both like the below.
Role.bulkCreate(rolesWithPermissions, {
include: {
model: Permission,
as: 'permissions',
},
});
This is creating Permission record but role_id in Permission record is null always.

NetSuite SuiteScript 2.0 get Company Name

Is there any way to get the current company name when on a transaction entry page? Either some session object, global object, or some sort. Kind of like how you can get the user name from the runtime module? I see country name, but cannot seem to get the company name. Using a client script for this.
How I get the user name:
runtime.getCurrentUser().name
thank you
Here is the working code now, but trying to figure a way to get this on a client script. Possible to pass this value?
var companyInfo = config.load({
type: config.Type.COMPANY_INFORMATION
});
var compname = companyInfo.getValue({
fieldId: 'companyname'
});
log.debug(compname);
scriptContext.form.addButton({
id: "custpage_mybutton",
label: "View Documents",
functionName: "onButtonClick"
});
scriptContext.form.clientScriptModulePath = "SuiteScripts/dl_cs_vendorbill.js";
In server side scripts you can do this:
require(['N/config'], config=>{
const info = config.load({type:config.Type.COMPANY_INFORMATION});
log.debug({title:'Current company Info', details:info.getValue({fieldId:'companyname'}));
});
For a client script you could use that code in a paired user event script.
In the before phase of the UE you'd do the lookup and then add a hidden field to the form with the company name as a value. Your client script can then look that up like any normal getValue

Azure add user authentication method using Microsoft.Graph.GraphServiceClient

I'm creating new user using GraphServiceClient with SignInType as userName something like this:
var user = new User
{
AccountEnabled = true,
GivenName = "Joe",
Surname = "Bob",
DisplayName = "Name",
Mail = "joe#bob.com",
MobilePhone = "111111111",
Identities = new List<ObjectIdentity>()
{
new ObjectIdentity
{
SignInType = "userName",
Issuer = "<Issuer...>",
IssuerAssignedId = "someName"
},
},
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = false,
Password = "<pass>"
},
PasswordPolicies = "DisablePasswordExpiration,DisableStrongPassword",
};
await gsc.Users.Request().AddAsync(user);
After that user is created in Azure and I can use this account for login into app that is using B2C SignIn policy. But when I want invoke ResetPassword policy for that user, after successfully email verification, I'm getting error: "An account could not be found for the provided user ID.". After some trial and error I've figure out that there is missing data in azure user profile tab "Authentication methods" When I fill out input for email everything is working fine and user is able to reset password.
So I'm searching for a way how to populate user email into this section "Authentication methods" during creation time.
In this circumstance, where you want to create users via Graph API, you cannot populate the strongAuthenticationEmail attribute usng Graph API. This attribute holds the email associated with a username based account for password reset operations. User Flows will read this attribute during password reset. Therefore this wont work.
You need to use a custom policy for a username based journey and replace all instances of strongAuthenticationEmail with extension_whatever. Then in your Graph API payload, insert the email address in a key called extension_GUID_whatever.
https://github.com/azure-ad-b2c/samples/tree/master/policies/username-signup-or-signin

Permission Access to Employee Data(Record)

How can i get permission or access?
I'm trying to build search in NETSUITE SSP Application and I get the following error:
ERROR TITLE: "YOU_CANNOT_PERFORM_THIS_SEARCH_BECAUSE_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_EMPLOYEE_DATA"
I have tried: nlapiloadrecord()
Then I tried saved search method to get employee record
Search function
function getContact(sEmail) {
var aFilter = new Array();
aFilter.push(new nlobjSearchFilter('email', null, 'is', sEmail));
var aResult = nlapiSearchRecord('employee', null, aFilter, null);
}
What role are you using while executing the above script?
If you only want to view(perform search) on employee record, you can contact your admin and ask them to give access on Employee record for the said role of type View.
You can check this out for further reading on Roles and how to create/edit/update one in NetSuite.

Google contacts api endpoint authenticated user contacts name is blank

Im using https://www.google.com/m8/feeds/contacts/default/full?alt=json&oauth_token='+accessToken+'&max-results=10000&v=3.0
to get authenticated user contacts
and it's returning contact list of authenticated user but the contacts name is blank, if one contact updated in gmail then that contact getting name, why is that happening?
Is there any wrong in above url
Did you get the contact name from the title
For example, you can get the value from the title field from following title field:
"title": {
"$t": "Tester Name",
"type": "text"
},
Its normal that some contacts might have a blank title and you can use a placeholder for their names.

Resources