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: (Web) Add Opportunity Product customizations
Kevin
Posts: 20
 
(Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 5:58 AM

I need to modify the Add Opportunity Product form, removing a few columns and adding two more.  


 


I have the columns removed and the other columns present where I want them, the problem is when you update a value in any of the columns  and click the 'Update' link on the line item, I have problems. 


I know this is around the "helper" class, but frankly am stepping into uncharted waters.  Any help would be appreciated.



Thanks,


Kevin

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 12:50 PM

Check out the file "AssOpportunityProductHelper.cs" in the app_code folder.  I would reccomend working in Visual Studio and then pulling your changes back in AA once you get it where you want it.

[Reply][Quote]
Kevin
Posts: 20
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 3:01 PM

Thanks ... that is the right place, mostly but here's my problem.


 


I can change everything here, but this uses the Sage.SalesLogix.Opportunity.OpportunityHelperClass which is compiled in the BusinessRules.dll


 


It takes six columns (String, Object, Double, Decimal, Double, String) and i need it to take a slightly different six columns (String, Object, Double, Decimal, Decimal, String).  Being that it is compiled, I can't change it.


Thoughts on next steps?



Thanks!

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 3:26 PM
fiogf49gjkf0d

I would reccomend using reflector to see what's in that Update fuintion and just replicate the code in the helper class.  Ditch the logic in the DLL and replace with you own code.  Reflector shows the following coee in the Update function:


 


    IOpportunityProduct oppProd = GetOppProd(original_Id, original_InstanceId);
    oppProd.Program = program;
    oppProd.Discount = new double?(discount);
    oppProd.Quantity = new double?(quantity);
    if (oppProd.CalculatedPrice.HasValue && (oppProd.CalculatedPrice.Value != calculatedPrice))
    {
        oppProd.CalculatedPrice = new decimal?(calculatedPrice);
        oppProd.CalculateCalcPrice();
    }
    else
    {
        oppProd.CalculateDiscount();
    }

[Reply][Quote]
Kevin
Posts: 20
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 5:46 PM

That's what I've been doing, but running into problems.



When i use the code below, I get an error " CS0103: The Name "GetOppProd" does not exist in the current context:using System;


using System.Collections.Generic;


using Sage.Entity.Interfaces;


using Sage.Platform;


using System.ComponentModel;


using Sage.Platform.ChangeManagement;


using Sage.SalesLogix.BusinessRules.Properties;


using Sage.SalesLogix.BusinessRules;


using System.Reflection;


 


namespace Sage.SalesLogix.Client.App_Code


{


    /// <summary>


    /// Opportunity Helper rules class


    /// </summary>


    public class AddOpportunityProductHelperClass


    {


        #region public gridview methods


        /// <summary>


        /// Selects the specified opportunity.


        /// </summary>


        /// <param name="opportunityId">The opportunity.</param>


        /// <returns></returns>


        public static IList<IOpportunityProduct> Select(string opportunityId)


        {


            return Sage.SalesLogix.Opportunity.OpportunityHelperClass.Select(opportunityId);


 


        }


 


        /// <summary>


        /// This method exists for the rare case where the object data source will call select without


        /// our custom parameters.


        /// </summary>


        /// <returns></returns>


        public static IList<IOpportunityProduct> Select()


        {


            return Sage.SalesLogix.Opportunity.OpportunityHelperClass.Select();


 


        }


        /// <summary>


        /// Updates the specified original_ id.


        /// </summary>


        /// <param name="original_Id">The original_ id.</param>


        /// <param name="original_InstanceId">The original_ instance id.</param>


        /// <param name="calculatedPrice">The calculated price.</param>


        /// <param name="quantity">The quantity.</param>


        /// <param name="netRevenue">Net Revenue</param>


        /// <param name="comments">Comments</param>


        public static void Update(string original_Id, object original_InstanceId, decimal calculatedPrice, double quantity, decimal netRevenue, string comments)


        {


            Sage.SalesLogix.Client.App_Code.AddOpportunityProductHelperClass1.Update(original_Id, original_InstanceId, calculatedPrice, quantity, netRevenue, comments);


 


            //Sage.SalesLogix.Opportunity.OpportunityHelperClass.Update(original_Id, original_InstanceId, discount,


             //                                                         calculatedPrice, quantity, program);


        }


 


 


        /// <summary>


        /// Deletes the specified original_ id.


        /// </summary>


        /// <param name="original_Id">The original_ id.</param>


        /// <param name="original_InstanceId">The original_ instance id.</param>


        public static void Delete(string original_Id, object original_InstanceId)


        {


            Sage.SalesLogix.Opportunity.OpportunityHelperClass.Delete(original_Id, original_InstanceId);


        }


 


        /// <summary>


        /// Inserts the specified opportunity.


        /// </summary>


        /// <param name="opportunity">The opportunity.</param>


        /// <returns></returns>


        public static IList<IOpportunityProduct> Insert(string opportunity)


        {


            return Sage.SalesLogix.Opportunity.OpportunityHelperClass.Insert(opportunity);


 


        }


 


        /// <summary>


        /// Gets the current opportunity.


        /// </summary>


        /// <value>The current opportunity.</value>


        public static IOpportunity CurrentOpportunity


        {


            get


            {


                return Sage.SalesLogix.Opportunity.OpportunityHelperClass.CurrentOpportunity;


            }


        }


 


        #endregion


 


        #region Private Static Methods


 


        public static IOpportunityProduct GetOppProd(string original_Id, object original_InstanceId)


        {


            IOpportunityProduct oppProd = null;


            if (CurrentOpportunity != null)


            {


                foreach (IOpportunityProduct op in CurrentOpportunity.Products)


                {


 


                    if (op.Id != null)


                    {


                        if (String.Equals(op.Id.ToString(), original_Id))


                        {


                            oppProd = op;


                            break;


                        }


                    }


                    else


                    {


                        if (String.Equals(op.InstanceId.ToString(), original_InstanceId.ToString()))


                        {


                            oppProd = op;


                            break;


                        }


                    }


 


 


                }


            }


            else


            {


                oppProd = EntityFactory.GetRepository<IOpportunityProduct>().Get(original_Id);


            }


            return oppProd;


        }


 


        #endregion


    }


 


    public class AddOpportunityProductHelperClass1


    {


        public static void Update(string original_Id, object original_InstanceId, decimal calculatedPrice, double quantity, decimal NetRevenue, string comments)


        {


            IOpportunityProduct oppProd = GetOppProd(original_Id, original_InstanceId);


            oppProd.Program = program;


            oppProd.comments = comments;


            oppProd.Quantity = new double?(quantity);


            if (oppProd.CalculatedPrice.HasValue && (oppProd.CalculatedPrice.Value != calculatedPrice))


            {


                oppProd.CalculatedPrice = new decimal?(calculatedPrice);


                oppProd.CalculateCalcPrice();


            }


            else


            {


                oppProd.CalculateDiscount();


            }


           if (oppProd.NetRevenue.HasValue && (oppProd.CalculatedPrice.Value != netRevenue))


            {


                oppProd.NetRevenue = new decimal?(netRevenue);


                oppProd.NetRevenue();


            }


            else


            {


                oppProd.NetRevenue();


            }


 


        }


 


 


 


    }


}

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 10 6:31 PM
fiogf49gjkf0d

Is this an external assebly you are writing?

[Reply][Quote]
Kevin
Posts: 20
 
Re: (Web) Add Opportunity Product customizationsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Nov 10 4:24 AM
fiogf49gjkf0d

I've tried it both ways as an external assembly and using the scripts already present and get the same error.

[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 1:47:21 PM