8/17/2025 6:26:36 PM
|
|
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!
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.
|
|
|
|
Data not saving to the child table
Posted: 30 Apr 09 12:54 PM
|
This post is about 7.5 web. I added a new textbox on the insert ticket smart part which is bound to a custom child table. M:1 relationship is set to the ticket table. on the page, whatever data inserted on that particular textbox is not getting saved. What could be wrong. am i missing something?
Thanks Johnson |
|
|
|
Re: Data not saving to the child table
Posted: 01 May 09 4:03 AM
|
If you have added the table as a one to one (many to one in 7.5 world) then you would need to call the save method on the other table as well as the ticket table.
What you should really do is set the child table up as an "Extension Entity". this will automatically populate ID's for the child table and call its save() method when you save Ticket. Let me know if you need steps to do that.
Thanks, Nick |
|
|
|
Re: Data not saving to the child table
Posted: 04 May 09 6:07 PM
|
Thanks Nick. Well, I am not sure if I did things right. Let me explain my scenario: I need to copy the details of a ticket to another ticket. The Ticket table has a child table "Inquiry". I had initially added this table as a child table. I had to delete the relationship from Entity Model -> Relationships since when I add it as an extension the code did not compile and it complained of duplicate definitions of Inquiry in ITicket (One in '#region 1:M Relationships' and another one in '#region Child extensions') "ERROR - C:\Sage\Platform\Output\interfaces\ITicket.cs(308,31):The type 'Sage.Entity.Interfaces.ITicket' already contains a definition for 'Inquiry'"
Now in Entity Model -> Packages -> Saleslogix Application Entities I double-clicked "Inquiry" and changed it properties as below: I checked "Is Extension" to true and selected "Ticket" from the corresponding dropdown displaying all the entities. In the "Saleslogix Extended" tab I changed String Expression to "${Ticket}" - though I was not sure what I was doing (I looked into the other extensions and did the same thing for "Inquiry" also). To open up the Insert Ticket screen I created a button on "Ticket Detail" and in its OnClickAction I used a redirect - Main View Entity Mode = Insert URL = InsertTicket.aspx?modeid=insert Use Current Id in link = True
In the Load Actions of "InsertTicket" form I added a C# Snippet Action Item after the default Validation Rule (IsAutoPunchinEnabled). I changed the "On Entity Changing" and "On Repaint Event" to True for this snippet action item.
In the C# Snippet Action Item, I entered the following logic to load data from my source ticket:
if (Page.Request.QueryString["entityid"] != null) { Sage.Entity.Interfaces.ITicket currentTicket = (Sage.Entity.Interfaces.ITicket)this.BindingSource.Current; Sage.Entity.Interfaces.ITicket oldTicket = Sage.Platform.EntityFactory.GetById(Page.Request.QueryString["entityid"].ToString()); . . . currentTicket.Inquiry.Name = oldTicket.Inquiry.Name; . . }
The "InsertTicket" screen does not show the values in the form but it saves when I save the new ticket. I know I am missing something major - I am basically doing a trial and error method since I don't have any useful help material. I looked at the "Application Architect Help", it does not say anything about "Extension Entities". Is there any help material from sage or anybody else which explains the steps to be performed while doing such things (I have had so many instances where I missed out some small step and ended up getting no results with no warnings or errors) Thanks in advance for your help. |
|
|
|
Re: Data not saving to the child table
Posted: 05 May 09 8:53 AM
|
I feel you are very much on track. Just check you are certainly getting the oldticket object initiated. May be debugging would help you.
Regarding standard document I think best bet would be Devlogix Book by Stephen. |
|
|
|
Re: Data not saving to the child table
Posted: 05 May 09 6:07 PM
|
Thanks Sandeep. I verified that the oldTicket object gets instantiated and the currentTicket persists the values assigned through the code snippet. The problem is that when the page is rendered, they do not get displayed. But if I save the new ticket, the values are saved into the database and I can see them on the TicketDetail page redirected. Also, if I change a control in the page having an AutoPostBack = true (say for example, a dropdown list "Status"), then all these values get populated. Is it that my code snippet works just after all the page elements (or controls in the page) are assigned values? Is the any other place where I can populate the values in the page elements through code? Can anyone please explain me the life cycle of a page/smartpart? |
|
|
|
Re: Data not saving to the child table
Posted: 06 May 09 9:15 AM
|
Can you confirm which event you are setting the values in? It sounds like it's too late, but a quickformload wouldnt be too late. Once you set the entity values the bindings on the controls would set them to the correct values.
I would try to run the code in a quickformload - using the C#Snippet Action Item. So Insert Ticket, Load Actions...Add, C# Snippet Action Item (Obsolete), put the code in save, build/deploy.
Thanks, Nick |
|
|
|
Re: Data not saving to the child table
Posted: 08 May 09 8:39 AM
|
Yes Nick, it's quickformload. Now I can save the values - but the thing is that initially the form does not show any values. Anything extra to be done through code to make the values appear in the form? |
|
|
|
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!
|
|
|
|
|
|
|
|