No key field(s) specified in attribute mapping. inDataDirector import bundle for Pimcore - pimcore

The DataDirector import claims '[WARNING] No key field(s) specified in attribute mapping. Falling back to using all mapped fields as key fields. Please go to attribute mapping and set one or more fields as key fields which can be used to find already existing elements.'
All Pimcore Fields are already mapped.
How to fix it?

find the field which can be used as a key on 'Attribute mapping' /
'Attributzuordnung' (2) tab in dataDirector for your dataport.
Click on '<>' icon to open callback function editor
Activate the checkbox on top of callback function editor
Optionally, you can set this field as unique and mandatory in the class definition

Related

Override key values in hybris map editor

Is it possible to override the key values that are being populated for a map type attribute of an itemtype in backoffice? I've found the default MAP editor and spent almost 2hours debugging the application to see how the key values are populated but I couldn't find anything. For example, I want to display only 3 out of 5 enum values based on some logic when a new map entry is created.
I think you have two options.
You can create a custom editor to extends the map editor https://help.sap.com/docs/SAP_COMMERCE/5c9ea0c629214e42b727bf08800d8dfa/8bd4c25286691014b3f9876ca5816926.html
You can define a new itemType to store your pair key-values and use the Default Multi Reference Editor https://help.sap.com/docs/SAP_COMMERCE/5c9ea0c629214e42b727bf08800d8dfa/8bad002786691014924ba694583a1368.html to configure search options

Is it possible to create my own custom KvExt table to fully implement and manage User Defined Fields for my custom table and page?

I have a custom table in SQL Server called AnimalBreed and maintenance page.
I wish to add User Defined Field support via the KvExt approach instead of
traditional practices involving either CSAnswers or a CacheExtension of the
DAC and underlying "Usr" fields.
Is this possible?
Can it be done for line-level (child) DACs, such as
existing INLocation and INLocationKvExt?
Thanks!
UPDATE:
It appears the feature needs at least:
ensure your table has the NoteID column as uniqueidentifier datatype and the DAC has the corresponding field: Guid? NoteID and [PXNote()] attribute.
In the ASPX, if not ListView, add the following to the PXDataSource tag:
EnableAttributes="true"
By making these changes, I can Manage User Defined Fields, choose Attributes to include, and I can store values to the KvExt table.
I am using Version = 19.205.0023
Sales Order page observation: if I add two UDFs on SO Order Entry page, one is combobox and one is checkbox, setting their values saves just fine, but then updating the combobox and save leads to loss of the checkbox (from true to false), unless you uncheck and recheck prior to the save. Is this a bug?
Maybe technically possible but definitely not recommended to use undocumented feature like KvExt.
If you need to deploy User Defined Fields on a page which already contains them. Configure them manually and then add them in a customization package in the user defined fields section for deployment as described here:
https://help-2019r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=e01f29d3-b6b1-40f4-a2d1-45c9d01bdde3
Example:

Question about the [PXDimension] attribute

If I set up my own segmented key ID to be used with a custom DAC's identity field, Do I need anything else other than the [PXDimension] attribute on that DAC field to implement the enforcement of that segment setup?
You would have to define your custom field with the [PXDimensionSelector] attribute.
When this attribute is used, the first parameter should be the dimension name (defined in the Segmented Keys page - CS202000), followed by the ID value (this is the value persisted in the DB), and then the CD value (this is the user-friendly value).
For instance, the Item Class Dimension selector can be defined like this:
[PXDimensionSelector(INItemClass.Dimension,
typeof(Search<INItemClass.itemClassID, Where<INItemClass.stkItem, Equal<False>>>), typeof(INItemClass.itemClassCD), DescriptionField = typeof(INItemClass.descr))]
When the value is then added to the UI, the framework will recognize the Dimension-selector attribute and it will create it as a PXSegmentMask field instead of a regular PXSelector

How to populate an edit field with the computer host name?

I have an edit field that is set to a property.
Now I want that property initially populated with the host name.
Things I've tried so far:
[%ComputerName]
[ComputerName]
{ComputerName}
None of which are working
It's unclear where you put that, but I'm assuming you mean the Property setting for the edit control. That won't work. Instead you need to associate the edit control with a regular property (so it can be updated), and set the value of that property with a Set Property custom action before this is shown.
Note that in order to support supplying the value from a command-line install (especially a silent one) you may wish to condition the Set Property action not to fire when the property already has a value.
To set a default value for this control, make sure the property is a public property by giving it a name that contains only uppercase letters, use the Property Manager view to add the public property, and then assign to it the value of the default selection.
Before accessing this property first you need to set that property. You need to call either SetProperty CustomAction or you need to add that property in Property Manager.
And [COMPUTER_NAME] is the correct way to access it.

How to create a lookup column that targets a Doc Lib and uses the 'Name' of the document?

How do you create a lookup column to a Document Library that uses the 'Name' of the document as the lookup value?
I found a blog post that recommends adding another custom field like "FileName" and then using a item reciever to populate the custom field with the value from the Name field but that seems cheesy.
Link to the blog in case people are interested:
http://blogs.msdn.com/pranab/archive/2008/01/08/sharepoint-2007-moss-wss-issue-with-lookup-column-to-doc-lib-name-field.aspx
I've got a bunch of custom document content types that I dont want to clutter with a work around that should really work anyway.
I created a one step workflow to set the title from the name, fired on modify and created. Seems to work and took seconds to create.
One way you can do this (although not the easiest way) is by creating a custom field type that extends the SPFieldLookup class. SharePoint's field editor for Lookup fields purposefully hides any columns types that aren't supported by Lookup fields, but you can create a field editor for your custom field type that shows them.
However, I have created a Lookup column that points to a Name column in a Document Library before, and it probably doesn't work like you'd expect. While the value stored in the lookup column is valid, it doesn't show up right in List view or on the View Properties form.
The solution you posted may actually be the best way to handle this. Lookup fields require some kludges if you want to handle more complex scenarios, but that's because they're not meant to provide the same functionality as a foreign key relationship in a database.
Coding in any form always scares me. So Here's what I did: I simply renamed the Stupid "Title" Field to something else, say "Keywords", since you cant do anything with that field: cant even make it mandatory.
Then I created another Single line field called "Title" and used this field for the Lookups
Well there is a simple solution to that and in might work in some case.
In the nutshell if you make the Title field Mandatory, this will force the user to enter a title. In that manner we can use title field as a lookup field.
Now How to do that?
One you are done create a document library go to the library setting. Select Advance Setting and Select Yes for the option "Allow management of content types?".
Then go back to the Library setting and Under content types select the "Document" Content type. THen Select Title Column and then Select "Required (Must contain information)" and say OK.
Now try uploading a document to this document library. You will see Title field in the form.
Hope this helps
Cheers
Vaqar
You have to add the field as XML with the ShowField as 'FileLeafRef'
var XmlFieldDefinition = "<Field DisplayName='myLookupColumn' Type='LookupMulti' StaticName='myLookupColumn' Name='myLookupColumn' Required='FALSE' List='THE LOOKUP ID HERE' WebId='THE WEB ID HERE' UnlimitedLengthInDocumentLibrary='TRUE' Mult='TRUE' Sortable='FALSE' ShowField='FileLeafRef' />"
Field fld = fieldCollection.AddFieldAsXml(XmlFieldDefinition, true, AddFieldOptions.DefaultValue);
ClientContext.Load(fld);
ClientContext.ExecuteQuery();

Resources