XMLport Table Attributes - dynamics-nav

XMLport objects in NAV appear to support table attributes (i.e. Node Type = Attribute, Source Type = Table). However, when I try to save an XMLport containing a table attribute node in NAV 2013, I get this error message:
The SourceType Table for Tag <MyTableAttribute> can only be assigned to TagType Element.
This (http://msdn.microsoft.com/en-us/library/hh165612(v=nav.70).aspx) page on MSDN seems to confirm that table attributes can be used. What purpose would a table attribute serve? What would be an example of a typical application of table attributes?

Table (record) cannot be source for attribute. Because record is a set of fields, i.e. it has multiple values, when attribute must have concrete single value. A field can be used as source for attribute of element. And record must be source for the element. That is what error message says.

Related

How to write multiple relation query in SOQL

I am performing SOQL query to get the contact detail of a customer my parent and child table relationship is as follow.
child_table
parent_table
grandparent_table
I am trying to get contact_name from Contact(Grand Parent) from Event(Child) and I trying something like this.
select Name,
Venue__r.Contact__r.Name
from Event__c;
Can anyone suggest me what I am doing wrong and what is a correct way to get it?
Your query syntax is fine. Make sure that your lookup names are correct. In your linked parent diagram, the object is named 'Vanue'.
Also, it's very important that you use the local field name for each object relationship reference (__r).
Given your example SOQL
SELECT Name, Venue__r.Contact__r.Name FROM Event__c;
we can only assume the following details:
CUSTOM OBJECT Event__c has a STANDARD FIELD 'Name' and a CUSTOM FIELD 'Venue__c'
CUSTOM FIELD Event__c.Venue__c is a lookup to a PARENT or MASTER object which may or may not be named 'Venue__c', so we'll refer to it as [V].
CUSTOM OBJECT [V] has a CUSTOM FIELD 'Contact__c'
CUSTOM FIELD [V].Contact__c is a lookup to a PARENT or MASTER object which may or may not be named 'Contact__c ', so we'll refer to it as [C].
CUSTOM OBJECT [C] has a STANDARD FIELD 'Name'

how to assign value to lookup fields in salesforce

i have two objects KNDY4__Sales_Order__c and KNDY4__Bill_to__c.these two are linked through lookup relationship.i am trying to insert one order record as follows
`KNDY4__Sales_Order__c order=New KNDY4__Sales_Order__c();
order.KNDY4__Ship_to__c ='a14q0000001LnIeAAK';
order.KNDY4__Bill_to__r.Predicted_External_ID__c ='CN-0222741-Sold To';
order.KNDY4__Company__c ='a0l1N00000BQQKF';
Insert order;`
i am geting error as {"Object reference not set to an instance of an object."}.
how to assign values to lookup field.can anyone help me
When linking a record based on an external id, the relationship field needs to be set to an sObject with the external id, and not just the value of the id itself.
On line 3, since KNDY4__Bill_to__c is a lookup field to a custom object possibly named KNDY4__Customer__c, you should set the value of the lookup to an instance of that object, e.g.
order.KNDY4__Bill_to__r = new KNDY4__Customer__c(KNDY4__Predicted_External_ID__c ='CN-0222741-Sold To');

Pentaho salesforce upsert using externalID

I am trying to insert data in salesforce using upsert, for one field i am using the ExternalId field , i have tried many combinations but it fails...I get the error : the syntax should be object:externalId/lookupField
Any idea what is the exact syntax? Keep in mind i am inserting in table Account and the externalId field refers to Account also
object:externalId/lookupField is not very clear is it. There's a comment hidden away in the Pentaho code:
// We use an external key
// the structure should be like this :
// object:externalId/lookupField
// where
// object is the type of the object
// externalId is the name of the field in the object to resolve the value
// lookupField is the name of the field in the current object to update (is the "__r" version)
Lets say you're populating a Salesforce Object Foo__c, which has a Lookup field to Contact called Contact__c. The 'relationship name' for that lookup field would then be Contact__r.
On Contact lets say you have added an External ID called Legacy_Id__c and thats what you want to use when populating Foo__c.
What Pentaho would want in the Module Field column would then be:
Contact:Legacy_Id__c\Contact__r
The bit to the left of the slash is telling Pentaho which object/external id to map to. To the right of the slash, its telling Pentaho which lookup/relationship on Foo__c to fill in.

Changing abbreviation values coming for Database in ADF view Object

I am using ADF JDeveloper 11g Release 2
I am using Entity object called Project referring to actual database table. This table contains fileds that hold abbreviation values; for example this table have filed called STATUS that describe the current status for the project. this filed will have values like: 'A' for Approved, 'X' for Rejected, and so on.
In the interface( JSPX, or JSF Pages) I am just drag and drop the View object that refers to the Project Entity object. and the page will display the project records with their status as specified.
Question is:
Is there any way to change this observation values to the actual value somewhere; That is, Instead of having values like ( A, X,...) I want to have ( Approved, Rejected,...)
You can create a transient attribute at VO level. In the value of this attribute you can write groovy expression which will use the value of attribute named status and decode it.
Alternatively, you can alter the VO query using DECODE function by doing something like this :
SELECT name and other fields needed,
DECODE(status, 'A', 'Approved',
'X', 'Rejected',
'P', 'Pending',
'Default') decodedstatus
FROM projects;
You will need to have an additional attribute in VO in this case and can directly use the value returned by VO in UI.

Creating rule based on field collection field

What I want to do is trigger an action when one of the fields on my field collection is changed to a certain value. For example, my 'campaign' node has a field collection with a field called 'status' This status is a list containing 3 options; 'onboard', 'live', or 'dead'. When the field on a campaign node field collection is set to 'live' I want to trigger an action.
So I start by saying:
Events: After node is updated
Conditions: This is the bit I am struggling to work out as I cannot do a data comparison with this particular field.
Action: send email
How can I achieve this?
You may get it to work by using an approach similar to what is mentioned in comment # 4 of issue # 1315566, i.e.:
Create an "entity has field" condition on your Rule.
For the "Data Selector," select the entity that contains the field (in my case, a node). For the "Field" value, select the machine name of the field collection in question.
Go to your action. Using the "Data Selector" mode, you should be able to drill down through the entity in question to all the values contained within the field collection. In my case, the end result is "node:field-enrollee:field-school-district:0:tid"
In your case you try to do what is mentioned in step 3 above as a Rules Condition (instead of a Rules Action). So add a Rules Condition "Entity has field" (prior to being able to use it anywhere later on in your rule), which refers to your field collection field.
For way more details about this, refer to "How to iterate over all field collection items in the Rules module?" (which also includes a rule in export format you may want to experiment with, if you only adapt some machine names of the used fields).

Resources