Expand my Community achievements bar.

SOLVED

link betwen reference table and others tables

Avatar

Level 2

Hi everyone,

 

I want to replace the userEnum in my data schema by the reference table. The reference table content all values.

Here'is my the reference table

  <element desc="Reference table" hybrid="false" label="Reference table" labelSingular="Reference table"
           name="referenceTable">
    <key clustered="true" internal="true">
      <keyfield xpath="@countryCode"/>
      <keyfield xpath="@referenceTableName"/>
      <keyfield xpath="@ReferenceColumnName"/>
      <keyfield xpath="@value"/>
    </key>
    <attribute desc="Client Country code"  label="Country code"
               name="countryCode" type="byte"/>
    <attribute desc="Reference table name" label="Reference table name" length="50"
               name="referenceTableName" type="string"/>
    <attribute desc="Reference column name" label="Reference column name" length="50"
               name="ReferenceColumnName" type="string"/>
    <attribute desc="value" label="value" length="50" name="value" type="string"/>
    <attribute desc="Label" label="Label" name="label" type="string"/>
    <sysFilter>
      <condition enabledIf="HasNamedRight('rightAllData')=false" expr="[currentOperator/@countryCode]=[@countryCode] and @IS_deleted=false"/>
    </sysFilter>
  </element>
</srcSchema>

 

And create the link with the another table but i'm not how i can use the dstFilterExpr in my link;

Below the link between all data schema with reference table

 

<element displayAsField="true" label="Reference table" name="referenceTable" target="cus:referenceTable" type="link" noDbIndex="true" noDbIndex="true" 
	 dstFilterExpr="@ReferenceColumnName = 'type'" dstFilterExpr="@referenceTableName = 'reward'">
		  <join xpath-dst="@countryCode" xpath-src="@countryCode"/>
		  <join xpath-dst="@value" xpath-src="@sType" />
</element>

 

The dstFilterExpr="@ReferenceColumnName = 'type'" dstFilterExpr="@referenceTableName = 'reward'" is the value in my reference table. 

 

Someone can help me plz ?

 

MDIA

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @diabbs,

 

dstFilterExpr helps to filter out the data which will be exposed by the link.

As per the documentation, the dstFilterExpr should be added to the join tag and not to the element tag.

 

Example as per documentation:

 

<element name="StockEN" type="link" label="MyLink" target="cus:Stock">
<join xpath-dst="@country" xpath-src="@code" dstFilterExpr="@country = 'EN'"/>
</element>

View solution in original post

4 Replies

Avatar

Correct answer by
Employee

Hi @diabbs,

 

dstFilterExpr helps to filter out the data which will be exposed by the link.

As per the documentation, the dstFilterExpr should be added to the join tag and not to the element tag.

 

Example as per documentation:

 

<element name="StockEN" type="link" label="MyLink" target="cus:Stock">
<join xpath-dst="@country" xpath-src="@code" dstFilterExpr="@country = 'EN'"/>
</element>

Avatar

Level 2

Hi,

 

Thanks, i finally fixed my issue.

Many thanks

 

 

Avatar

Level 2

Hi @AnanthanJa ,

 

finally i have some question, in my case i have an issue.

when i use query tool from the recipient to the loyalty account i'm getting error, the same error in input form recipient.

here th link betwen my tables

 

recipient -> loyalty -> referenceTable

 

Do you know why it's not working ?

 

Thanks

Mohamed

Can we do something like this?

 

<element name="StockEN" type="link" label="MyLink" target="cus:Stock">
  <join xpath-dst="@country" xpath-src="@code" dstFilterExpr="@country LIKE @code"/>
</element>

 

[OR]

 

<element name="StockEN" type="link" label="MyLink" target="cus:Stock">
  <join dstFilterExpr="@country LIKE @code"/>
</element>

 

Basically I'm trying to find a way to join to tables/schema using LIKE operator rather than equal to operator.

Thanks,

Krishna