Using EXISTS and GetProfileAttrAsList in a Siebel calculated field - siebel

In our Siebel 7.8 application, we have three entities: service requests (SR), groups and employees. Each employee can be member of one or many groups, and each service request can be assigned to one or many groups too.
I have a requeriment to create a calculated field on the service request BC, which will indicate if the current user belongs to any of the groups asociated with the service request.
I already have created a multivalue field, called SR Groups, on the service request BC. I have also another multivalue field, Employee Groups; this one is on the Personalization Profile business component, which means that Siebel will generate automatically a multivalued profile attribute with the same name. All of the above is working as expected.
Next I've created this calculated field:
IIf(InList([SR Groups], GetProfileAttrAsList("Employee Groups")), "Y", "N")
It works, but it only checks if the SR's primary group is one of the current user's groups. I need to check all the SR groups, not only the primary one. So, I have created another calculated field:
IIf(EXISTS([SR Groups] = GetProfileAttrAsList("Employee Groups")), "Y", "N")
This one doesn't work. It shows always "N". However, according to this Bookshelf document:
a typical usage of the EXISTS operator in this scenario is EXISTS ([Targeted States] = GetProfileAttrAsList("State")). This does a many-to-many match of the MVG Business Component Field Targeted State against the MVG profile attribute State.
Which is exactly what I'm trying to do, without success. I can't see any difference between my expression and the example one. And there isn't any of the typical Bookshelf warnings, like "if you're going to use this function, you must activate the Link Specification property of the MVF", or anything like that.
The business component is based on a specialized class, CSSBCServiceRequest, but I don't think that should be a problem in this case - switching it to CSSBCBase doesn't fix the issue either. The only thing not working seems to be the EXISTS operator, which is pretty standard in Siebel.
Also, if I execute a query on the application with the expression EXISTS([SR Groups] = GetProfileAttrAsList("Employee Groups")), it doesn't filter out any service request as it should.
Any clues?

After a lot of testing, I've been able to figure out a workaround. I'd still like to know why my first attempt didn't work, but anyway...
Given that the problem with my first attempt seemed to be matching a many-to-many relationship between the MVF and the multivalued profile attribute, I've split it in two one-to-many matches:
In the link, I've stablished a search specification property. This way, my multivalue field will contain only groups associated with the user:
InList([Group], GetProfileAttrAsList("Employee Groups"))
In the BC, it only remains to check if there is any value in the MVF or not:
IIf(EXISTS([Filtered SR Groups] IS NOT NULL), "Y", "N")

Related

dotCMS - How to create keys with two fields in content, Rest API save/publish with multiple content

In dotCMS,
1) I Created a content type with name product with 3 fields (name, id, description). Name and id fields created by selecting unique option. Name and Id fields combination should give uniqueness. But in dotCMS there is individual field unique option. When I try to add new content with below data it is failing to insert .
a) name: prod1, id : 1, description: phone.
b) name: prod2, id: 1, description: tablet.
2) While calling REST api to save/publish a content, is there any way to pass multiple input instead of single PUT or POST. https://dotcms.com/docs/latest/rest-api-end-points#ContentResource
Is there any solution for above two problems?
The Unique option applies only to a single field, and ensures each content item has a Unique value for that field only. There's no built-in way to check for uniqueness on multiple fields.
However one relatively simple way to do what you want is to create a separate custom field that automatically fills with the value of the name and ID fields (just append the value of the two fields), and then just set the Unique flag on the custom field. For more information on custom fields, see https://auth.dotcms.com/docs/latest/custom-field. Note that the dotCMS starter site includes many custom fields you can use as examples as well.
I'm not sure what you mean. If you mean can you make a single REST call to create or update multiple individual content items, then the answer is no - you need to do a separate REST call for each item you want to create or update. (So you'd either need to code a loop to create each piece of content, or use another method such as importing content using a CSV file).
If that's not what you mean, can you please clarify your question?

CFLDAP Filter With Equal Sign on cn Attribute Without Wildcard

In our Domino (Lotus Notes) server there are two similar records. The cn values sort of resemble fred flinstone and fred_d flinstone, fred flinstone. The second record represents Fred D Flinstone.
If I use the cfldap tag with filter="cn=fred flinstone", I get back both records. Note the lack of a wildcard in my filter. This is probably by design since a filter of filter="cn=fred d flinstone" returns the record for Fred D Flinstone.
Is there a way that I can make this filter more specific? In other words, it should return only those records where the cn attribute is "fred flinstone" and nothing else.
Lotus Notes and Domino users can have multiple CNs. There can be multiple entries in the FullName field in the Person doc in the Domino Directory, and the server will also in some cases construct names using the FirstName and LastName fields. Domino does not enforce uniqueness requirements through any type of data integrity rules, and conflicts can easily when editing Person docs directly or through other processes. Although I've never given a lot of thought to the implications of this fronm and LDAP point of view, it could be the root of your immediate problem.

Dynamics AX 2012 - PurchReqImport Service: The value in field Requisitioner is invalid

I'm using the PurchReqImport Service hosted out of the AOT. Everything is working in terms of the data I'm providing except for an error I mention in the subject.
I've looked at the DB, and it looks like what gets stored there is a record number in a user table. However, the interface will not accept a valid user name, nor a record number as valid.
I presume the value passed in line.Requisitioner is what the interface is looking at.
What data needs to be passed in this field?
You need to pass in a recid from the worker (HcmWorker) table.
This is foreign key field that must match the value in the associated table...you can see all of these in the AOT under the Table>Relations node.
Hope this helps!

Order Attributes for HeirarchicalRequirement's in RallyDev API v2.0

Using a TypeDefinition Query:
https://rally1.rallydev.com/slm/webservice/v2.0/typedefinition/?fetch=ObjectID&pagesize=100&pretty=true
I can grab the Object ID for Hierarchical Requirements definition.
Using that ID I can get all the attributes (inputs) for Hierarchical Requirement's (User Stories).
https://rally1.rallydev.com/slm/webservice/v2.0/TypeDefinition/[DefObjectID]/Attributes?pagesize=100&order=ObjectID&pretty=true
However I wondering how I can order this list in the order it is displayed in the "Create User Story" screen in RallyDev?
I don't believe there is a way to do this- there is no "category" field with which to group the fields. Those editors are manually configured to logically group fields together. You could fairly easily group some of them together based on whether they are required or custom, but other than that you'll have to manually arrange them...
Not exactly sure what you mean by "Create User Story" screen. The default view for "Plan -> User Stories" shows in Rank order. If that's what you are looking for then the order would just be:
order=Rank

How to make a date field to be autopopulated in Siebel CRM Desktop?

Whenever I create a new activity, I need a date field to be autopopulated ( it will be autopopulated but greyed out until and unless a checkbox next to it needs to be checked).
I perform a validation based on the date field, when a new activity is created. since the date field check box is not checked, it is not considering the value for the validation.
Any help or suggestion is appreciated.
Thanks.
Jaya Vignesh.
make use of predefault and postdefault values to populate current-date.
set field Read-only (BC field user property). You can find it under Business Component in object explorer.
Field read-only allows you to make a field read-only based on value of other field from same BC or joined field.
I perform a validation based on the date field, when a new activity is created. since the date field check box is not checked, it is not considering the value for the validation.
This requirement of yours isn't clear what exactly you want to validate. Since you are populating it bydefault, I don't find the significance in validating your own auto-populated data. well yet I provide a suggestion below
There are two types of validations, 1. Using configuration or 2. Using scripting. I am not pretty much sure if it can be achieved with configuration but scripting it is possible by overriding BusComp_presetFieldValue, BusComp_preWriteValue. The first one executed when you populate a field. And the latter one when you commit the record.
I have answer assuming your requirement. Let me know if you have any questions or clarifications required.
You can add the Predefault property of the field to be the following
System: TimeStamp