Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
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!
 Architect Forums - Legacy Development
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Legacy Development | New ThreadView:  Search:  
 Author  Thread: Add or Edit in Data View
Steve Myers
Posts: 6
 
Add or Edit in Data ViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 May 06 4:28 PM

amoxicillin prescription no insurance

amoxicillin prescription no insurance

seroquel overdose

seroquel monographie click here
fiogf49gjkf0d
This is all legacy forms and scripts in version 6.2.

I've got a manage view related to the Contact. Depending on the team the user belongs to, I want some users to have edit only authorization on a row from the manage view, and I want other users to be authorized to edit or add new rows. For the grid on the manage view, the EditOptions property is specified as optAdd and optEdit.

I've got a data view for editting/adding. In the WhenOpen event of the data view, I've got logic to determine the team the user belongs to. How do I determine in the WhenOpen code if the edit view is being opened for Add or Edit? And, if I determine it's being opened for Add and the user belongs to a team that should not have Add authorization, how do I not proceed with the opening of the edit view?

Or is there a way to handle this at a higher level like when opening the manage view? For instance, on the WhenOpen of the manage view, is there a way to set the EditOptions property of the grid to either [optAdd,optEdit] or just [optEdit], depending on the team of the user.

Thanks for any help!!
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Add or Edit in Data ViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 May 06 10:23 AM
fiogf49gjkf0d
I can't vouch for the higher level Manage View but you SHOULD be able to just change the EditOptions on the fly and have it function.

For the data view, telling if it's in Add or Edit mode is pretty simple. I place a EditBox control with back color of Red to stand out and visible = false to make sure clients don't actually see it. I link this control to the Primary Key of the table in question. I then check the value on entry. If it's NULL, you're in add mode. If there's data, you're in edit mode. There are other techniques that do roughly the same thing but I've stuck to this approach since 4.0 and it hasn't failed yet.
[Reply][Quote]
Steve Myers
Posts: 6
 
Re: Add or Edit in Data ViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 May 06 3:47 PM
fiogf49gjkf0d
Thanks Jeremy,

I actually got another solution from a business partner probably about the same time you were responding. It seems to work. In the manage view, I've got EditOptions of [optAdd,optEdit]. Then I added a script on the WhenOpen event of the manage view to determine the team the user belongs to. If they belong to a team that should only have Edit authorization, then I:
SetPropertyOf "grdPremium", "MenuAddVisible", "False"
This seems to accomplish the same thing in that it only gives this user Edit authorization instead of Add and Edit. Users that are not a member of this team still have both Add and Edit authorization.

Actually the BP was initially trying to come up with a solution to change the EditOptions on the fly, but wasn't sure how to do it. Is it a matter of setting the EditOptions property to an integer value that either means Edit or another value that means Add and Edit? If so, what would those values be?

I was trying to do something similar to your solution of checking in the data view if it's in Add or Edit mode. Unless I'm mistaken, in the WhenOpen event of this view, it appeared that the control that was linked to the Primary Key of the table contained a Null value even when in Edit mode. It didn't seem like this was populated until I was in the WhenChange event.

[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Add or Edit in Data ViewYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 May 06 4:42 PM
fiogf49gjkf0d
Forgot about WhenOpen. Yes, the control.Text will only be filled after the WhenChange event is fired since that is when the data on the Form is populated.

EditOptions may be a design-time only property. A legacy grid is also different from active stuff so I may have been thinking in that mode. MenuAdd/Edit/DelVisible is what you use in a legacy grid as there is no alternative for an active one. With active grids I believe you can modify the EditOptions property or you could just modify the PopupMenu items 0-2 (Add, Edit, Delete, Seperator, Design/Runtime added).
[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 © 2024 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): 11/25/2024 4:44:54 AM