Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 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!
 External Development Forums - General External Development
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General External Development | New ThreadView:  Search:  
 Author  Thread: Application.BasicFunctions.ShowAddForm( )
veeranjan
Posts: 19
 
Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 7:22 AM
fiogf49gjkf0d
how can i user Application.BasicFunctions.ShowAddFor(Tablename,viewname,BindDataPath,BindVALUE)
funcation.
in the parameters list a didn't understand object BindDataPath and object BindValue parameters
where can i get these..

Thanx
Veeranjan
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 10:14 AM
fiogf49gjkf0d
There is not a function in Application.BasicFunctions called "ShowAddForm". Are you maybe referring to ShowViewForRecordEx? If so, try using the simpler ShowViewForRecord instead and it will likely fit your needs. See more on ShowViewForRecord here: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=48

-Ryan
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 12:46 PM
fiogf49gjkf0d
Mr. DevLogix mentioned the ShowAddFor() (no 'm') command back when v7 was first introduced on an ITToolbox posting. I poured through the Developer's ref. hoping to find it but it's not documented. The reason I need it? The MainView loading technique for data forms only works in 'Edit' mode. There is no current way in 6.2 to turn the data manager from "Edit" to "Insert" despite the MainView.SetDataMode method (or the fact that it's not documented correctly in the most current documentation).

I thought ShowAddFor() was introduced to combat this fact but it appears it was either left out of the documentation because it's no longer there, or it's just undocumented. I've yet to pour through the object browser to confirm or deny it's existence.

It'd be a shame because there's really no other way to emulate a grid's Add command programmatically. The best solution we have is to create a shell record and edit that, which is just wasteful in my book.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 2:07 PM
fiogf49gjkf0d
Ah so it is. It does exist (at least in the v7 system I am on). I just checked the object model. Defined as:

Function ShowAddForm(ByVal TableName As String, ByVal ViewName As String, [ByVal BindDataPath], [ByVal BindValue]) As String


It is omited from the docs however. Probably just overlooked. However, you are still able to use "Add" mode with MainViews. The "SetDataMode" method allows you to specify whether you're opening the form in Add or Edit mode.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 2:08 PM
fiogf49gjkf0d
Jeremy just pointed out that ShowAddForm does exist, just not documented. It is defined as:

Function ShowAddForm(ByVal TableName As String, ByVal ViewName As String, [ByVal BindDataPath], [ByVal BindValue]) As String


As far as the BindDataPath & BindDataValue goes, as you can see from the definition, those are both options and can be left blank.
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 06 3:53 PM
fiogf49gjkf0d
Quote:
Originally posted by Ryan Farley

However, you are still able to use "Add" mode with MainViews. The "SetDataMode" method allows you to specify whether you're opening the form in Add or Edit mode.


SetDataMode takes 2 parameters in 6.2. The first is an enum in which 0 represents edit mode and 1 represents insert. The second parameter is the NewID or the primary key value of the table the mainview represents. The best I've gotten is to call GetIDFor(), pass the value into the NewID parameter and have it show up on the primary key control in the form. It does not create the underlying record, at least not in the way a typical data form does.

I'd love for this to be a case of me just not knowing how it all works but something tells me ShowAddForm was introduced to overcome this hurdle.
[Reply][Quote]
Guy Barrett
Posts: 63
 
Re: Application.BasicFunctions.ShowAddForm( ) Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 11 11:26 AM
fiogf49gjkf0d

If it helps...

Syntax: Function ShowAddForm(ByVal TableName As String, ByVal ViewName As String, [ByVal BindDataPath], [ByVal BindValue]) As String

To keep this simple. Let's say that there are two tables. ACCOUNT and ACCOUNT_BEAN. In ACCOUNT_BEAN we are storing all the different types of bean that the ACCOUNT in question enjoys. Baked, Kidney, Broad etc...

When I invoke ShowAddForm - I want to pass to it the relationship between the ACCOUNT_BEAN and the ACCOUNT itself to integrity is not lost.

For this, I have the following variables...

strACCOUNTID - The AccountID of the account that the ACCOUNT_BEAN is related to
strVIEWNAME - The name of the view I am invoking

I would then invoke the function like this...

Application.BasicFunctions.ShowAddForm "ACCOUNT_BEAN", strVIEWNAME, "ACCOUNT_BEAN:ACCOUNTID", strACCOUNTID

Really, really simple when you know how. Getting the knowhow is a different matter!

[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/22/2024 3:59:45 AM