Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 27, 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: Disabling/Read only for opportunity products grid
Brannon Buchanan
Posts: 14
 
Disabling/Read only for opportunity products gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Sep 12 8:35 AM
fiogf49gjkf0d

I thought this would be simple but evidently I'm missing something.  In the OpportunityProducts form I'm trying to disable the grid "grdOppProducts" based on the status of the opportunity.  I've got a form onload action setup that checks the opportunity status but when I check the form object there is no reference for the grdOppProducts grid.  I was thinking I would be able to dynamically set the read only condition to true but since I can't reference the grid not sure how to reference the read only property? 


 



#region Usings
using System;
using Sage.Entity.Interfaces;
using Sage.Form.Interfaces;
using Sage.SalesLogix.API;
#endregion Usings


namespace Sage.BusinessRules.CodeSnippets
{
    public static partial class OpportunityProductsEventHandlers
    {
        public static void OnLoad1Step( IOpportunityProducts form,  EventArgs args)
  /*
  * Date: 9/27/12
  * Programmer: Brannon Buchanan
  * Descr: Disabled quotation data when quote type is a quote
  */
        {
   
   IOpportunity opportunity = (IOpportunity) form.CurrentEntity;
   
   if(opportunity.Status=="Quotation")
   {
       form.<no reference for grdOppProducts??>       
      
   }
        }
    }
}

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Disabling/Read only for opportunity products gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Oct 12 12:44 PM
fiogf49gjkf0d

You have to either create it as a code snippet action on the form itself, or you could implement is as a boolean returning rule or code snippet property on the entity and then just bind it to the enabled property. But, not way to reference form elements in business rules themselves and that is intentional. You don't want to reference the form in an entity event or rule. That would break things like mobile/sdata/etc.

[Reply][Quote]
Brannon Buchanan
Posts: 14
 
Re: Disabling/Read only for opportunity products gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Oct 12 2:09 PM
fiogf49gjkf0d

I thought I was trying to call the snippet from the form as you suggested but I definately could be missing something (I'm very new to this dev environment).  The previous code I posted was a C# code snippet action item invoked as a load action from the opportunityproducts form.  And typically I can reference form controls from these types of snippets.  I even added a custom label to the form to see if the new control would show up via intellisense within my load action snippet and it worked fine.  I submitted a case to sage and their feedback is that it is a defect with the editable grid control.  They were suggesting some potential work arounds including using dual tabs (one read only and one editable) that would be dynamically invoked based on criteria.  I had looked into a function for the read only property but I'm still trying to figure out the symantics of the function.  Was trying to return True when the opportunity status = "Quotation".  Will probably keep hammering down this route.


Thanks for the feedback.  Let me know if you have any further suggestions or if I'm missing something on the code snippet action for the form.

[Reply][Quote]
Brannon Buchanan
Posts: 14
 
Re: Disabling/Read only for opportunity products gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Oct 12 2:14 PM
fiogf49gjkf0d

Just in case someone in the future is trying this thought I would pass along the javascript function I used on the read only condition of the grdOppProducts to get this to work:


function () {
if(document.getElementById("ctl00_MainContent_OpportunityDetails_wbrOpportunitySnapShot_pklType_Text").value=='Quotation')
{
return true;
}
else
{
return false;
}
}


Also had to add similiar criteria to hide condition of the edit hyperlink column.


 

[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/27/2025 5:47:57 PM