How to use the result from comparing 2 forms and set fields in 3rd form in BMC Remedy ARSYS? - remedy

Please see the below scenario
I have form A,B and C.
I search B using fields from A to get a result list.
result list contains one column with IDs of C form.
Now I want get a field from A, set it in C for only those IDs returned by B.
I know if confusing but I have made it as simple as possible. Please help me accomplish the above operation in BMC Remedy Developer Studio (ARSYS)

Your question isn't very clear, but I think that I understand your need. I think the primary issue is that you are thinking in terms of the GUI (results lists, active links, etc.). Instead you need to think of server-side workflow, filters and escalations. The other key is to use hidden fields to hold your IDs, data to push, flags.
I'm not sure what your trigger will be to make this all happen, so that will change the workflow. You could start with an entry A being created/modified. This will trigger a filter that does a set fields action querying B to pull back the IDs and save them into a hidden field. You then have another filter on A that checks for a value in the hidden ID field. It does a push fields action to save the data from A into the correct entry of C.
That's the basic idea which could be improved with a better understanding of the fields and flow.

Related

Create a dropdown menu specific for company in AX

I would like to create a dropdown in AX form so that only the user from specific company see this field as a dropdown and other company see it as string field that user have to manually key in. I only manage to create the dropdown list based on table menu, but have no idea how to limit to specific company.
This create a problem since not all company wants dropdown and If the user key in none registered number, the system will return “ the value xxx in the field yyy is not found in the relating table zzz
How can I set the condition so that only selected company see this field as dropdown and the other company see this as string? And also where to locate the condition?
You may need to set the form control property AutoDeclaration=Yes and then dynamically change the FormStringControl.LookupButton (see here) based on the current company (curext()).
You must also decide if you have a relation on your table, whether or not you want it to be enforced (Validate=[Yes/No]). If you are allowing a free-text field input, I would imagine you would want No, but you could perform validation in the validateField or validateWrite method.
Depending on your situation, you may want to create a custom lookup with a condition.
See how to create custom lookups here - https://learn.microsoft.com/en-us/dynamicsax-2012/developer/how-to-add-a-lookup-form-to-a-control
You'll have to experiment a little, but this information should point you the right direction.
You could add two fields to your form, on with the lookup and one without. You could then use the security setup to control which users have access to which field. Note that this may not work if you have users that work in both companies that use the field with lookup and companies that use the field without lookup.

Voting on items - how to design database/aws-lambda to minimize AWS costs

I'm working on a website that mostly displays items created by registered users. So I'd say 95% of API calls are to read a single item and 5% are to store a single item. System is designed with AWS API Gateway that calls AWS Lambda function which manipulates data in DynamoDB.
My next step is to implement voting system (upvote/downvote) with basic fetaures:
Each registered user can vote only once per item, and later is only allowed to change that vote.
number of votes needs to be displayed to all users next to every item.
items have only single-item views, and are (almost) never displayed in a list view.
only list view I need is "top 100 items by votes" but it is ok to calculate this once per day and serve cached version
My goal is to design a database/lambda to minimize costs of AWS. It's easy to make the logic work but I'm not sure if my solution is the optimal one:
My items table currently has hashkey slug and sortkey version
I created items-votes table with hashkey slug and sortkey user and also voted field (containing -1 or 1)
I added field votes to items table
API call to upvote/downvote inserts to item-votes table but before checks constraints that user has not already voted that way. Then in second query updates items table with updated votes count. (so 1 API call and 2 db queries)
old API call to show an item stays the same but grabs new votes count too (1 API call and 1 db query)
I was wondering if this can be done even better with avoiding new items-votes table and storing user votes inside items table? It looks like it is possible to save one query that way, and half the lambda execution time but I'm worried it might make that table too big/complex. Each user field is a 10 chars user ID so if item gets thousands of votes I'm not sure how Lambda/DynamoDB will behave compared to original solution.
I don't expect thousands of votes any time soon, but it is not impossible to happen to a few items and I'd like to avoid situation where I need to migrate to different solution in the near future.
I would suggest to have a SET DynamoDB (i.e. SS) attribute to maintain the list of users who voted against the item. Something like below:-
upvotes : ['user1', 'user2']
downvotes : ['user1', 'user2']
When you update the votes using UpdateExpression, you can use ADD operator which adds users to SET only if it doesn't exists.
ADD - Adds the specified value to the item, if the attribute does not
already exist. If the attribute does exist, then the behavior of ADD
depends on the data type of the attribute:
If the existing data type is a set and if Value is also a set, then
Value is added to the existing set. For example, if the attribute
value is the set [1,2], and the ADD action specified [3], then the
final attribute value is [1,2,3]. An error occurs if an ADD action is
specified for a set attribute and the attribute type specified does
not match the existing set type. Both sets must have the same
primitive data type. For example, if the existing data type is a set
of strings, the Value must also be a set of strings.
This way you don't need to check whether the user already upvote or downvote for the item or not.
Only thing you may need to ensure is that the same user shouldn't be present on upvote and downvote set. Probably, you can use REMOVE or ConditionExpression to achieve this.

Displaying data in a datagrid in an Alfresco task form

I have a json array variable defined in my activity workflow definition. Now, I need to present the data of the json array in a datagrid inside a form task. One of those columns should be a check entry filed so that the user may select some rows. After that, I need to get back that data in a subsequent form task (so I need the data to be updated in the json variable so I can read it back, mainly the user selected checks).
Any example to accomplish this? I didnt find almos nothing relating with using datagrids in Alfresco task forms.
thank you!
Miguel

AX 2012 initFrom methods

I understand that these initFrom(TableName) methods are to initialize fields in a table for related tables. Where are they called from? I want to follow this pattern but where do I call this method?
Every documentation on this pattern just tells me what I said above and no examples of using them. I see examples of them being created.
Maxim Lazarev made a point about using the cross-reference tool. I ignorantly did not realize that you had to update it on the table and then you can see what calls on that method. That lead me to examples of it being used in overridden table methods like modifiedField. I'm starting to play around but it looks like I can now use these initFrom methods to fill in specific data I need in forms whether it's directly in the table or in the actual form itself.
The initFrom methods are to initialize the record based on another record. They are not called automatically, you can use them yourself
though.
For example PurchTable.InitFromVendTable() sets all the relevant values from the vendTable to the (new) purchtable record. So if you want to create a Purchase Order and you have the vendor, you can use this method to set the correct values.

Complex Rule in Drupal involving multiple entities

I need to create a fairly complex rule in Drupal - I am willing to use either code or the interface to do so.
I am more familiar with the interface, however, as opposed to the Rules API.
Anyway, the rule will be as follows:
It will happen based on a form submission from entityforms (which is one entity). It will take the checkbox value of a field (not just the true or false, but rather the value submitted when a value is true or false). It will convert this number to an integer.
At this point things get interesting - I want to create a new entity of registrations (a different entity), which as far as I can tell, means I'll have to bring a registration into scope. I also need to bring node (and not just node: type and other data selectors, but specifically node) into scope, because the next step requires it.
So at this point, I should have three entities loaded into scope:
entityforms
registration
node
I believe the best way to bring registration into scope would be entity is of type? The documentation page says that content of type should be appropriate - but that seems like it might be related to the specific use case of the example - not in my more complex example where registration isn't the first entity dealt with, but rather a second.
https://drupal.org/node/1463042
So anyway, if all three of these entities is called in correctly, the ultimate result should be the following:
Value from boolean field (not the straight 1 or 0, but whatever the value to be submitted is switched to) from the entityform is converted to an integer, and inserted where entity host ID is required. In the section where host entity type is the value should be node.
I am also open to alternative suggestions if this seems overly complex or poorly architected.
The Host Entity Type cannot be of Entityform? Why be a Node since a Registration can be attached to any entity? Then you will get the id of the Entityform as also as any other fields from that entity type instead of Node. Next steps are the same.

Resources