Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: ShowViewForRecord not working
Veronka Capone
Posts: 113
 
ShowViewForRecord not working Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Sep 08 4:08 PM
OK,

I have read couple of posts that said if I have a data form, I could use ShowViewForRecord to Add/Edit the fields in the DB.
Well, it's not working ...what am I doing wrong?
----------------------
Problem 1
----------------------
Here is what I did:
1) I have a Manage Form (frmParent) with a button btnEdit.
2) When click btnEdit I call ShowViewForRecord("Custom_Table", "Personal:PMT_Svc_MyCustomDataForm", strEquipmentID)
3) Custom_table is a child table(1:1 relation schip with thwe parent table, where the PK = strEquipmentID)
4) When I click OK button in the child form, no new record is inserted.

----------------------
Problem 2
----------------------
...and I have a second problem (maybe related to the first one??)

1) As a workaround Problem 1, I manually insert a new record into Custom_table, using a recordset
With oRS
.AddNew
.Fields("ESI_EQUIPMENTID").Value = strEquipmentID
.Update
End With
then I call ShowViewForRecord to edit data in my child form.

2) In the Data Form(PMT_Svc_MyCustomDataForm) I have couple of checkboxes bound to Bool fields in the table.
3) When I click OK, NULL are saved into those bool fields intead of F. (I don't want NULL. I want to force it as F if the user click OK)

I checked 'Required', 'Checked' properties on these controls, but it made no difference.

Any suggestions?
- Veronka
[Reply][Quote]
Stephen Redmond
Posts: 190
 
Re: ShowViewForRecord not working Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Sep 08 2:14 AM
Hi,

The "ID" fireld of ShowViewForRecord is the ID for the table that you want to edit, not a parent table. You pass a blank string instead of an ID to create a new record.

If you want to link the record to a parent, you can use ShowViewForRecordEx:

Dim AID

AID = "CGHEA0002670"

Application.BasicFunctions.ShowViewForRecordEx _
"BANKINFO", "Account:Add Edit BankInfo", "", _
"BANKINFO:ACCOUNTID", AID



Stephen

[Reply][Quote]
Veronka Capone
Posts: 113
 
Re: ShowViewForRecord not working Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Sep 08 10:53 AM
Quote:

Dim AID

AID = "CGHEA0002670"

Application.BasicFunctions.ShowViewForRecordEx _
"BANKINFO", "Account:Add Edit BankInfo", "", _
"BANKINFO:ACCOUNTID", AID


Is this means that I will insert a new record into BANKINFO table, with BANKINFO:ACCOUNTID = 'CGHEA0002670' ? How can I get the value of AID in the child form (Account:Add Edit BankInfo) ?

I tried the same logic, and get a new record in the child table, with a new ID, different from the one which I passed in ShowViewForRecordEx function.

Also, Application.BasicFunctions.CurrentViewID, frm.CurrentID, txtAccountID.Text (the text field which is linked to the BANKINFO:ACCOUNTID) are all empty when I open the child form. (I checked OnOpen and OnChange).

BTW. I am using version 7.2, if this makes any difference.

Thanks.




[Reply][Quote]
Veronka Capone
Posts: 113
 
Re: ShowViewForRecord not working Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Sep 08 11:16 AM
Oh MAN,

This is very strange...

I appended a & "" to the variable which I am passing in the ShowViewForRecordEx (e,g, AID & ""), I can see the ID which I am passing to the child form, on OnChange event. So now my record gets saved correctly to the child table.

what a headache !!!
[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): 8/25/2025 12:57:07 PM