Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, June 29, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Duplicates when adding related entity. What am I doing wrong???
NixDev
Posts: 98
 
Duplicates when adding related entity. What am I doing wrong???Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jul 10 10:06 AM
Hi all,
I have the following scenario:

-SalesOrder entity, a SalesOrder can be associated to many contacts.
-I need to display a "Sales Order Contacts" grid in a quickform so the user can associate contacts to a sales order.

So, a SalesOrder has many SalesOrderContact, a SalesOrderContact is associated to one SalesOrder and one Contact.

SalesOrder (1) <- (m) SalesOrderContact (m) -> (1) Contact

Ok, so I create a SalesOrderContact entity. This entity has SalesOrderContactId, SalesOrderId and ContactId properties, and is in a 1:M relationship to SalesOrder (On SalesOrderContact.SalesOrderId = SalesOrder.Id). SalesOrder now has a child property called "SalesOrderContacts". I create a M:1 relationship to Contact (on SalesOrderContact.ContactId = Contact.Id). All good, i create the quickform and add a lookup to the toolbar to associate contacts to sales order.

Log into web client, go to SalesOrder, click on lookup, add contact "john doe". It displays properly on the grid.

-John Doe

Click on lookup, add contact "Homer Simpson". Two contacts are now displayed in the grid, but both are set to "Homer Simpson"???:

-Homer Simpson
-Homer Simpson

I check in the DB, and yes, there are two records, both with the same contactId. If I add a third contact "Moe", i get three records, 1 of them is "Homer Simpson" and the other two "Moe".

-Moe
-Homer Simpson
-Moe

If I add a fourth contact "Lisa Simpson", I get one Homer, one Moe and two Lisas.

-Lisa
-Homer Simpson
-Moe
-Lisa

So, everytime I add a new Contact, it gets added to the collection of contacts, but the last one entered is also set to this new contact. This happens at the DB level, i can check the Contact Ids and yes, they are duplicated (meaning, its not that the grid query is generating dups because of an improper join, or similar. There must be something that I misconfigured somewhere, but i can't figure out what.

I recreated the SalesOrderContact entity twice and i always get the same weird behaviour.

Any ideas/suggestions?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/29/2025 6:42:46 PM