Update objects from two modules with same attribute in DOORS - requirements

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"""
}
}
}

Related

Vuejs model inserting data to multiple models

I have created dynamic attributes,
There are three products in the array, then each of them has its own attributes.
Everything works fine initially, once I run "Copy Attributes" code to copy attributes to all other products, the input model starts inserting model value to all other attributes too.
for(let i in this.products) {
if(i != this.product_active) {
this.products[i].attributes = this.products[this.product_active].attributes
}
}
Here is the fiddle i have created for this issue:
https://jsfiddle.net/sukhcha_in/4o9k2ezn/
In this fiddle you will see three products with their own attributes (Input model works fine),
Now press "Copy Attributes" button, attributes of the active product will be copied to other products too.
Now input data to any product, the input model will input same data to all products, instead of selected product. It completely ignores the selected product.
Is there any issue with my code?
You copy the same attributes object to all three products, hence the properties are shared.
Instead, you should create a new copy of the object when copying, e. g. like this using the spread syntax:
for(let i in this.products) {
if(i != this.product_active) {
this.products[i].attributes = {... this.products[this.product_active].attributes}
}
}

Prestashop PHP import customized value Features

I am trying to add some custom Features in Prestashop v. 1.6.
I have managed to import Pre-defined values, using the ID's of the Features, but now I have a large list of Features that I want to import, but this time I don't have ID's for them, and I want them imported onto the Customized value inside Prestashop Features.
This is the code for assigning features inside my importer:
foreach ($customProductObject->features as $feature) {
Product::addFeatureProductImport($product->id, $feature['id'], $feature['value']);
}
This is the code I use for assigning a Feature to it's respective ID inside Prestashop.
$features[] = ['id' => 11, 'value' => 192];
The 11 is the ID of a Feature in Prestashop (In my case: SIZE) and 192 is the ID of the Value (In my case: LARGE).
My question is this: How can I do this if I want to assign a value of a feature, but it is not stored in an already Pre-defined Value inside Prestashop?
Example: I want to assign a new feature (In my case: Colour, with id 12), with a custom value (In my case: red, blue, etc), but for which I don't have an ID, because it isn't stored in a Pre-defined value inside Prestashop, it will be a Customized value, inserted directly from a feed.
I tried this, with no success:
$features[] = ['id' => 12, 'value' => 'red'];

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 replace relationship field type object IDs with names / titles in KeystoneJS list CSV download / export?

In Keystone admin list view the handy download link exports all list items in a CSV file, however, if some of the fields are of Relationship type, the exported CSV contains Mongo ObjectIDs instead of nmeaningful strings (name, title, etc) which would be useful.
How can one force the ObjectIDs to be mapped / replaced by another field?
Keystone has an undocumented feature that allows you to create your own custom CSV export function. This feature was added back in April (see KeystoneJS Issue #278).
All you need to do is add a method to the schema called toCSV. Keystone will inject any of the following dependencies when specified as arguments to this method.
- req (current express request object)
- user (currently authenticated user)
- row (default row data, as generated without custom toCSV())
- callback (invokes async mode, must be provided last)
You could, for example, use the Mongoose Model.Populate method to replace the Object Ids of any relationship field with whatever data you want.
Assume you have a Post list with an author field of Types.Relationship to another list (let's say User) which has a name field. You could replace the author Object Id with the author's name (from the User list) by doing the following.
Post.schema.methods.toCSV = function(callback) {
var post = this,
rtn = this.toJSON();
this.populate('author', function() {
rtn.author = post.author.name; // <-- author now has data from User list
callback(null, rtn);
});
};
.toCSV() will be called for every document returned with the Model as the context. When used asynchronously (as above) you should return a JSON representation of the new CSV data by passing it as the second argument of the callback. When using it synchronously simply return the updated JSON object.

Openerp 7 many2one dropdown should display field of related record

If you install Openerp 7 with recruitment module. And create a simple entry with following values e.g.
Subject (internal field name = 'name') = 10 Year Experience
Applicant Name = Jhon Smith
Then if you create a custom module with following columns
_columns = {
'applicant_id': fields.many2one('hr.applicant', 'Applicant', required=True),
}
The view widget by default will show a drop-down with the Subject (internal field name ='name') field but i want to show applicant name (internal field name='partner_name') field in drop down, when creating a new record in my custom module.
In Summary how can I display Applicant's Name instead of Subject in drop-down widget in my custom module.
In openerp there is a function called name_get().This function returns a list of tuples containing ID of the record and name tobe displayed. So override this function and return list of tuples containing ID of the record and applicant name
You need to define applicant_id in _rec_name in your custom module.
Try this:
_rec_name = 'applicant_id'
Have a look at Predefined fields.