Hi All,
I have created a 1:n link between two tables recipient and contract. When we do a query choosing recipient as targeting dimension and contract as filtering dimension it gives me 0 results but data corresponding to recipient id are present in contract table.
Below is the code which I have added in contract table for creating one to many link between recipient and contract
<element label="Recipients" name="recipient" revLink="contract" target="nms:recipient"
type="link">
<join xpath-dst="@gid" xpath-src="@gid"/>
</element>
Kindly let me know if the linking is done correctly
Thanks,
Maheswari
Solved! Go to Solution.
Hi maheswarik23685204,
Seems you are on track. As per your comment, in Data tab you can see 32 records satisfying the criteria mentioned in your changed link(ABX Recipients) between Recipient and Contract schema.
Please have a look if you are selecting the correct link in your query Or you can try generic query editor output.
Regards,
Deb
Hi Maheswari,
Please try to check the following.
Regards,
Deb
Hi Deb.
1.Both the schema are having attribute "gid"
2. I am not sure how to verify relationship but more than one record available for same gid in contract schema and only one record available for that gid in recipient schema
3.When I choose gid from recipient link through configure list of contract schema I couldn't see any data in contract schema data tab.It gives me 0. Similarly when I choose gid from contract link of recipient schema it shows all recipient data but the value of gid is 0 for all records in recipient data tab
Could you please let me know what might be the issue
Thanks,
Maheswari
Views
Replies
Total Likes
Hi Maheswari,
Please can you try the following in your schema?
<element integrity="normal" label="Recipients" name="recipient" noDbIndex="true" revLink="contract" revIntegrity="normal" target="nms:recipient" type="link">
<join xpath-dst="@gid" xpath-src="@gid"/>
</element>
Regards,
Deb
Hi Deb,
I tried with above code but still same issue.
Thanks,
Maheswari
Views
Replies
Total Likes
Hi Maheswari,
Are you performing "Update Database Structure" post the change?
Regards,
Deb
Hi Deb,
After adding the code I have selected update database structure option but it doesn't show any option to update contract schema (checkbox disabled by default)
Thanks,
Maheswari
Views
Replies
Total Likes
Hi Maheswari,
I tried the exact same code and it is working for me.
Can you share a pseudo code version of your actual code so that we can figure out what is the exact issue?
Regards,
Deb
Hi Deb,
We found the issue but we didn''t know how to rectify it. Let me explain the scenario
Already a link exist between nms:recipient and abc:contract using cId (This is for global market abc is global namespace )
Below code is added in abc:contract
<element label="Recipient" name="recipient" target="nms:recipient" type="link">
<join xpath-dst="@cId" xpath-src="@cId"/>
</element>
Our requirement is to create same 1:n link between nms:recipient and abx:contract but with different fields gId. Here gId is a field in abx:contract which is an extension schema of abc:contract
Issue:
We didn't notice that already link is existing in global schema with same name , when we saw the preview of abc:contract schema
it shows like below
<element belongsTo="abx:contract" label="Recipients" name="recipient" pkgStatus="never"
revLink="contract" target="nms:recipient" type="link">
<join xpath-dst="@cId" xpath-src="@cId"/>
<join xpath-dst="@gid" xpath-src="@gid"/>
</element>
Thanks,
Maheswari
Hi maheswarik23685204,
It is good that you have figured out the issue.
In ACM, when you extend a schema no new table is created rather columns(attributes present in your new schema) are added to the existing table in database.
As you already have a link between the parent schema and recipient schema you can try a link between the extension schema and recipient with a different name to see if it works.
Regards,
Deb
Hi Deb,
Previous:
<element label="Recipients" name="recipient" revLink="contract" target="nms:recipient"
type="link">
<join xpath-dst="@gid" xpath-src="@gid"/>
</element>
Now I have changed code as below in abx:contract
<element label="ABX Recipients" name="abxRecipient" revLink="abxcontract" target="nms:recipient"
type="link">
<join xpath-dst="@gid" xpath-src="@gid"/>
</element>
In structure it shows two links for recipient in contract schema.Total no of contract records is 132. When I select gid from ABX Recipient link values are populating for gid but the count is 32 but
When I put a query with recipient as targeting and filtering dim selecting contract link exist such as gid of contract it gives 0 as results
Thanks,
Maheswari
Views
Replies
Total Likes
Hi maheswarik23685204,
Seems you are on track. As per your comment, in Data tab you can see 32 records satisfying the criteria mentioned in your changed link(ABX Recipients) between Recipient and Contract schema.
Please have a look if you are selecting the correct link in your query Or you can try generic query editor output.
Regards,
Deb
Hi Deb,
Now query is working as expected.Thank you so much
Thank you,
Maheswari
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies