11/26/2024 3:25:15 AM
|
|
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.
|
|
|
|
Opportunity Products
Posted: 06 Sep 07 8:17 AM
|
Hi,
Does anyone know if Opp products, competitors and contact are supposed to be on the insert opportunity screen? I have looked at the pages and code and it looks as though these items should be here, but all I have are the standard opp fields (name, status, account manager etc.)?
Thanks nick |
|
|
|
Re: Opportunity Products
Posted: 07 Sep 07 3:05 AM
|
Yes, they are they normally. This sounds like you either have reverted to legacy or someone's simply modified the form ! Check in Architect and re-release the original. |
|
|
| |
|
Re: Opportunity Products
Posted: 07 Sep 07 4:03 AM
|
And you'd be right !! However, same sort of thing for web - if they have modified the forms etc. But, no - it's not right. |
|
|
|
Re: Opportunity Products
Posted: 07 Sep 07 1:55 PM
|
It looks like they started to build those into the Insert opp screen, but never finished it or something. Looking at the page in AA, the product and contact areas are loaded on the page in the DialogWorkspace, although there is nothing that loads them in that workspace. No buttons or anything added to invoke them.
So, OOTB..no, they are not there. But it looks like they started to add them, just never fininshed that up.
-Ryan |
|
|
|
Re: Opportunity Products
Posted: 10 Sep 07 2:08 AM
|
Thanks Ryan, as I thought but good to get the experts opinion! On attempting to add the products grid onto the page, when you use the add button it gives the usual Object not set to instance of an object, as expected - just need to figure out how to put the products and other parts on this screen I guess! Although not sure what they would be bound to, as the opp doesnt really exist yet....oh well - trial and error time! |
|
|
|
Re: Opportunity Products
Posted: 10 Sep 07 11:08 AM
|
Yeah, my guess is this is the very reason why it isn't complete in the OOTB product as well. You would have to do something like create a SmartPart that allowed for adding the products, but instead of calling the Save business rule on the Opp product objects, you would instead put them into the state of the page. This may or may not be the best, or even good idea - but it is the first to come to mind.
Something like this (as long as your SmartPart inherits from EntityBoundSmartPartInfoProvider):
//assuming you already have a populated OpportunityProduct object at this point. //this will save the object into a collection in the State so you will have access to it //from your code when the "OK" button is clicked on the Insert Opp form. //All this is untested of course
Sage.Entity.Interfaces.IOpportunityProduct oppprod = this.BindingSource.Current as Sage.Entity.Interfaces.IOpportunityProduct; //oppprod is my already populated object that was bound to the form. //instead of calling it's Save method, will store it in the State to call this later. List<Sage.Entity.Interfaces.IOpportunityProduct> list; if (this.PageWorkItem.State["OppProductsList"] == null) list = new List<Sage.Entity.Interfaces.IOpportunityProduct>(); else list = (List<Sage.Entity.Interfaces.IOpportunityProduct> )this.PageWorkItem.State["OppProductsList"]; list.Add(oppprod);
Then, when the Save button on the main Insert Opp form is clicked, you'll grab that collection, go through and set the parent of each to the Opp and then call the Save method of each. Something like this:
Sage.Entity.Interfaces.IOpportunity opp = this.BindingSource.Current as Sage.Entity.Interfaces.IOpportunity; List<Sage.Entity.Interfaces.IOpportunityProduct> list; if (this.PageWorkItem.State["OppProductsList"] != null) list = (List<Sage.Entity.Interfaces.IOpportunityProduct>this.PageWorkItem.State["OppProductsList"]; if (list != null) { foreach (Sage.Entity.Interfaces.IOpportunityProduct oppprod in list) { //order of what gets called here might need to be played with oppprod.Opportunity = opp; opp.OpportunityProducts.Add(oppprod); oppprod.Save(); } }
opp.Save();
Anyway, you get the idea. Hope this helps.
-Ryan |
|
|
|
Re: Opportunity Products
Posted: 10 Sep 07 1:33 PM
|
Great thanks Ryan, I was considering the best way to save the products in memory. I'd actually started down the route of calling the Save() of the Opportunity when you click the Add button on the products grid, and simulating the way it works on the Opportunity Detail area (essentially giving the products something to bind to) - getting there but a lot of problems with this method along the way! If it proves to be non viable I will definitely give the above a go.
Thanks!
Nick |
|
|
|
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!
|
|
|
|
|
|
|
|