Hybris create permission for extended item type - permissions

The case we are dealing with: We have an item type A which is extended from B. Now we have a user group UG. They have to be able to create type A items in the BO, but not type Bs. Therefor we restricted them in item type level to have the permission to create item type A, but not item type B. These items have their own defined place in the tree and are listed in our Backoffice, so they have their own listveiw section. In this section if we would like to create a new A or B item, there is the + sign for it. The problem is, that the UG doesn't even able to click on the + sign even if they have permission to create type A.
What do we miss here?

Related

Update objects from two modules with same attribute in DOORS

I have one module with objects that have the attribute customer ID.
I have new module, with updated data, which was an import from PDF to DOORS using ReqMan.
Now I want to update the first module with data from the new module. The customer ID attribute is equal in both modules, but I cannot find a way in DOORS to do a sort of VLOOKUP to look for the customer ID and update the Object Text on the base module.
Preferably I would like to do it without DXL.
(modify the following instructions as needed - I describe my favorite settings here)
Use spreadsheet import and export, preferably Tab separated.
For export, create a view which does NOT contain Absolute Number nor the main column, but all the data you want to modify plus customer ID. Ensure that the labels of the columns are identical to the attribute names.
In the generated text file, you can change the attributes for existing rows and you can add new rows with customer IDs that do not yet exist in the module. Make sure that the first line contains the attribute names.
After you updated your text file, open the module and choose File -> Import -> Spreadsheet with the following settings :
Import to attributes: by column labes
Import options: Update existing objects
Update: All Objects
Data separator: Tab
Input file: the full path to your .tsv file
Advanced: check that the columns in the first row correspond to your attribute names
set the correct encoding
press Import
there should be no question "create new attribute?"
In the dialog "Select key", select "customer ID" as the "column/attribute that uniquely identifies the objects".
press "Select"
check the result, save the module only if everything looks correct.
Object ob, ob1
Module m = current // First module
string s="/Training Car Project/Stakeholder Requirements" //Give full path of your second module
Module mod=read(s,false)
for ob in m do
{
for ob1 in mod do
{
if((ob."customer ID""" = ob1."customer ID""") && (ob."Object Text""" != ob1."Object Text"""))
{
ob."Object Text""" = ob1."Object Text"""
}
}
}

How to get user from User field LookupId

I have a list in sharepoint online.
And in this list, i have a person field.
When i call the API endpoint to get all the items in the list, i get an LookupId value for the person field.
I tried to get the user by using the value of the lookupid, but it don't work because the id is not recognized.
The lookupid is a int (eg: 21) instead of a guid.
Is there something missing in the configuration of the person field or in my calls to Microsoft Graph API ?
When a user signs into a SharePoint site collection for the first time, a ListItem is created in a hidden User Information List. The LookupId in a PersonOrGroup field refers to the ListItem in this list. The URL for the User Information List for SharePoint Online should be:
https://{yourTenant}.sharepoint.com/{yourSiteCollection}/_catalogs/users/detail.aspx
Since the User Information List is a generic SharePoint list, you can query the list via Graph. First, get the list id for the User Information List. An easy way to get the list id is to view the source for the User Information Site via Chrome and search for 'listId'. You should find a result like this:
"listId":"{yourListIdIsHere}"
Copy the id. By using the copied id, the id of your root site and the LookupId, you can get the ListItem in the User Information List:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{pasteCopiedListId}/items/{lookUpId}?$expand=Fields
The ListItem contains information about the user, such as the email, which can be used to identify the Azure user:
https://graph.microsoft.com/v1.0/users/{eMail}
Question: How could i get the hidden User Information List from Microsoft Graph?
If you do not want to use the 'trick' with Google Chrome to get the id, there is another way to get the site. Typically, if you want to get the id for any site, you would call:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists
However, you will not find the id of the User Information List, even if you include hidden sites. I do not know why. An additional problem seems to be, that you cannot filter lists by their name:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists?$filter=name eq 'users'
The query returns an error, that the provided filter statement is not supported. The only way to get the list without knowing the id seems to by using the property displayName of the list. However, the displayName is based on your localization. So, since I am from Germany, I can get the site by using the query:
https://graph.microsoft.com/v1.0/sites/{siteId}/lists?$filter=displayName eq 'Benutzerinformationsliste'
You will need to replace Benutzerinformationsliste with your localized name. For EN replace it with 'User Information List'.
This returns the expected result:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('xxx')/lists(id,name,displayName)",
"value": [
{
"#odata.etag": "\"xxx\"",
"id": "xxx",
"name": "users",
"displayName": "Benutzerinformationsliste"
}
]
}
As you can see, the name of the list is 'users', so why the first filter statement does not work is a little mystery to me. Maybe someone here knows and can help out.
Some of the queries above don't work at the moment.
What I finally found as a good solution - after trying many many queries - is that you can do this by following the few steps below:
1- Get the GUID of the user information list.
Using the title of the list "User Information List" or the name "users" in the parameter "$filter" does not work.
Don't forget 'system' among the properties you select if you want to retrieve the hidden system-lists.
GET https://graph.microsoft.com/v1.0/sites('{site_id}')/lists?select=id,name,system
2- Filter the previous result in order to pick up the ID of the targeted list named 'users'.
By the way, applying this restriction "$filter=name eq 'users'" does not work.
You will get an exception. So you must do the filtering part by writing a few lines of code.
3- Once you've got the list identifier, then select all the items you want. And voilĂ ! The word 'Fields' must be in pascal case (uppercase the first letter ).
GET https://graph.microsoft.com/v1.0/sites('{site_id}')/lists('users_list_id')/items?$select=Fields&$expand=Fields
As #QuestionsPS1991 mentioned, the people field in fact refers to the hidden user list. With the lookupid, we can get the user via below methods:
Get user by id
Get user property by expanding lookup field
//////////// updated
By default, MS Graph does not return this user list. You may hard code the list id or follow ##QuestionsPS1991 suggestion. Below is my test:

Transaction BODY Field from COLUMN Field (Netsuite)

I have an issue where some of our orders are being imported directly into Netsuite, and there is information from the first line item, that I need to copy into the transaction record (i.e. custom field on sales order)
I want to set this up so that it is automatic, I don't have access to the system that is used to bring the orders into Netsuite, and I only JUST got suitescript access and everything I read about that is way above my head..
I know basic HTML and some of the scripting formulas from Netsuite and that's all.
I was hoping there would be a CUSTOM FIELD FORMULA or some other similar way that I can just easily source the information directly from the first item in the item sublist?
This would be quite trivial to implement using SuiteScript. The example below assumes you want to copy the Memo field (description) from the first line item to the body Memo field. The basic idea would be something like the below (untested code):
function userEventBeforeSubmit(type){
if (type === 'create') {
var record = nlapiGetNewRecord();
var memo = record.getLineItemValue('item', 'memo', 1);
record.setFieldValue('memo', memo);
}
}
If want to accomplish this via custom fields etc. it is possible using "Custom Fields with Values Derived from Summary Search Results".
To do this create a Saved Search as follows:
Type: Transaction
Criteria: [none]
Results: Formula (Text), Summary
Type = Maximum, Formula: DECODE({line}, 1, {memo}, NULL)
Available Filters: Internal ID
Then create a Custom Transaction Body Field as follows:
Type: Free Form Text
Store Value: F
Validation & Filtering > Search: [Saved Search from previous step]
As this is a dynamically calculated field (Store Value = F), it would be available when viewing the record, but not in Saved Searches and lists. To remove this limitation, you can create a Workflow that would copy this field to another one that is stored.

How to Fetch custom column value from Sharepoint 2010 user group

I have created an user group in SP 2010 and i have added one custom column to it, from the list settings.
How to get the custom column value in web part?
EDIT:
My custom column is District. I want to return that column value in visual web part application.
To return group users i use this code
List<SPUser> users = SPContext.Current.Web.SiteGroups["PDO Owners"].Users.ToList();
I assume you mean you created a custom property for the user profile as in my opinion you cannot add extra columns to user groups. You can get the values through the ProfileManager object doing something like this:
//GET THE USER PROFILE MANAGER
SPServiceContext sc = SPServiceContext.GetContext(site);
UserProfileManager userProfileManager = new UserProfileManager(sc);
//GET A PROFILE FOR A USER
UserProfile profile = userProfileManager.GetUserProfile("i:0#.f|fbamembershipprovider|myfbauser");
string propertyvalue = profile["propertyinternalname"].Value.ToString();
Depending on the type of field, you will have to use something else than ToString (eg for a managed metadata field i think you should use TaxonomyFieldValue, etc...)

SPListItem id from SPField object

I am working on create a custom field type and for implementation issue I need to retrieve the ID of the SPListItem in the SPField class which belong to these field type but I can't retrieve it.
For example:
public class myField:SPFieldText
{
// I need ListItemID in this class
}
Can anyone help me please?
SPFieldText is an SPField, which is the schema definition for a field. Its like saying, given an SQL create table statement, give me the id of row x. Can't be done.
I think the logic you are trying to perform should be done in an event receiver, so say when an item is saved, you take the ID and add it to the text field.
I didn't find a solution but I've tried another solution which is
I can get the ID of the item in the New and Edit forms so I saved the ID and the field value as a one value separated by '/' and in the SPFieldText class I've been able to retrieve the ID value from the value of the field