Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 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: Automatically refreshing fields after opening a form......
Dave Cleary
Posts: 61
 
Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 12 10:03 AM
fiogf49gjkf0d

Hi


I have a refresh dilema where I launch a form from a button, fill in some details on the form, close the form (saving the data) which then takes me back to the original form. This works okay and the data is saved, however there is a field on the original form that is also on the updated form which still shows the old entry until I come out of the original form and go back in where you can then see the updated value.


I presumed i'd be able to refresh this field using the standard refresh functions but they don't seem to work. I need the form to refresh when the updated form is closed (click Ok), can I somehow refresh the original form when closing another form?


I hope i've made sense....!!


Any advice would be appreciated.


Thanks


Dave

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Dec 12 11:30 AM
fiogf49gjkf0d

What is the script\function\line of code you are using for the launching of the form?


 


Do you have an AXFormChange subroutine and a databound field for the 'base' table on the base form?


 


What version of SalesLogix?


 


 

[Reply][Quote]
Dave Cleary
Posts: 61
 

<tr id="30744_messagerow" class="Normal">
<td width="16"></td>
<td>

Hi RJ


Thanks for the reply.....


What is the script\function\line of code you are using for the launching of the form?


Sub cmdSupplierClick(Sender)<br />Application.BasicFunctions.DoInvoke "Form","Account:DCL Supplier Select"
End Sub


Do you have an AXFormChange subroutine and a databound field for the 'base' table on the base form?


Yes I have a AXFormChange which I set a few field attributes depending on what department the user is in.


 


My databound field is where I think the problem lies. I have a lookup supplier field on my main form which calls the Supplier based on a foreign key linking to a supplier table. The supplier foreign key sits in an Elec Table which hangs off the Account table. This look up works as it should, I change the supplier and I can immediately see the change. Just to be clear i'm not using a pick list for the supplier, it's a look up in to the supplier table.


On this main form I also have a datagrid that links to an MPAN Table which hangs off the Elec table. There can be multiple MPANs for each account. To edit the MPAN details I right click and Edit which the brings up my MPAN form. What I really want is the Supplier lookup to be on this form (which is bound to the MPAN table). The supplierid field is on the elec table and therefore I can't seem to be able to edit it. I can display the value but when I change it it doesn't save which i'm presuming is down to the form being bound to the MPAN table. I can see the field from the MPAN table as the table joins are already in place but it just won't save any changes I make to it.


My work around for this was to launch another form from the MPAN form which then displayed just the supplier details (this form is bound to the elec table). I can then change the supplier and click ok and I can see the supplier on the main form change which is what I want, however the supplier on the MPAN form still shows the old supplier until I close it and go back in where it has then changed.


Sorry if this is long winded but I think to fix my workaround I need to some how refresh the last window I was on (i.e. the MPAN form). If I put in refreshes it seems to refresh the main screen or the active supplier form I can't seem  to refresh the MPAN form.


 


What version of SalesLogix?


7.2.2


</td>
</tr>

</table>
Re: Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 12 3:34 AM
fiogf49gjkf0d
<table id="30744_messagetable" border="0" cellspacing="0" cellpadding="3" width="100%">
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 12 4:39 AM
fiogf49gjkf0d

Rather than DoInvoke - use Application.BasicFunctions.ShowViewForRecord (pass in "" if you want a new ID) but, in essence, if you have this:


 


Form A - DataBound to data that displays Data then


FormB is invoked from a button/script from FormA that somehow affects the data on Form A then this will not automatically update Form A


If you had:


Main View -> Form A -> Update - then MainView would change


But, if you have:


Main View -> Form A -> Form B -> Form C - then any updates that happen on Form C (or B) won't reflect in Form A - you'd have to modify them yourself... (based on the return of the form).


 


Regards
Mike


 

[Reply][Quote]
Walter Shpuntoff
Posts: 167
 
Re: Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 12 5:10 AM
fiogf49gjkf0d

Here is another way you might do it.


Use your OnCreate of the base form to capture a reference to the form


Dim oForm


Sub AXCreate(Sender)


  set oForm = Sender


 


I assume you are launching your other forms via script, so at the end of your script


oForm.Refresh


will get your base form to refresh.


ws

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Automatically refreshing fields after opening a form......Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Dec 12 7:19 AM
fiogf49gjkf0d

1. Mike's suggestion to use ShowViewForRecord includes an automagic refresh of the form that the call is made from.....it's not in the documentation but it does a RefreshMainView every time (if you have a valid AXFormChangeScript.


 


2. you need an ID field, hidden, on your base form, for the base ID (AccountID, ContactID). That guarantees the AXFormChange.


 


3. In the AXFormChange, place a call to your grid refresh routine.


 


4. If you don't have a grid refresh routine, use SLX Profiler and see how many times you actually are firing off the grid refresh (duplicately!!). I've posted numerous times up here about using BINDID, SQL.Text = , having a :BINDID clause in the SQL statement for the grid, using Grid.Refresh, etc. ALL of which fire off the grid refresh.


 


5. Lookups will refresh on a form refresh, no problem there.....see Opportunity.Account if you don't think so....but you must have a valid AXFormChange and you must use ShowViewForRecord.


 


and all of this works properly in 7.2.2.


 


Walter's method works as well, but no need for it if you use ShowViewForRecord which includes the oForm.Refresh and the .RefreshMainView. That's how SLX changes the Opportunity Detail's Sales Potential when you edit the Opportunity Products tab OppProduct record on the popoup data form.


 

[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): 2/22/2025 3:51:51 PM