11/22/2024 3:55:08 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 general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
|
|
|
|
Application.BasicFunctions.ShowAddForm( )
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 |
|
|
| |
|
Re: Application.BasicFunctions.ShowAddForm( )
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. |
|
|
|
Re: Application.BasicFunctions.ShowAddForm( )
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. |
|
|
|
Re: Application.BasicFunctions.ShowAddForm( )
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. |
|
|
|
Re: Application.BasicFunctions.ShowAddForm( )
Posted: 06 Dec 06 3:53 PM
|
fiogf49gjkf0d 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. |
|
|
|
Re: Application.BasicFunctions.ShowAddForm( )
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! |
|
|
|
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!
|
|
|
|
|
|
|
|