Community
Showing results for 
Search instead for 
Do you mean 
Reply

Custom Field not refreshing

Accepted Solution Solved
Copper Super Contributor
Posts: 18
Country: United_Kingdom
Accepted Solution

Custom Field not refreshing

Hi,

 

My company form includes a user control drop down box for a custom field. When I first go into the application it displays the correct details. However if I change the record and navigate top another company and then return back  the old value is still displayed. I have checked the data base and the changed value is being updated there.  The same happens if I navigate to another company and change the value at the backend. On returning to the previous company the old value is displayed, it is almost as if it is caching the value. 

 

The code that I am using to retrieve the details is as:

 

string socaContact = comp.CompanyFields["SOCA Owner", FieldNameType.Alias].ToString();
for (int i = 0; i < socaCB.Items.Count; i++)
{
if (socaCB.Items[i].ToString() == socaContact)
{
socaCB.SelectedIndex = i;
break;
}
}

 

Can someone please help

 

Thanks & Regards

 

Satyajit

 

 


Accepted Solutions
Solution
Accepted by topic author satyajit_singh
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Custom Field not refreshing

Yes I am calling the update function to fore the value to be stored. The issue is not woith storing the value, it is with retrieving the latest value stored. For e.g if I first went into the company deatil view for a company record whose SOCA Owner was 'Chris' the val;ue displayed in the dropdown would be 'Chris'. However if I change it to 'Gary', the database is updated with this value but if I navigate to another company and then navigate back to this company the value dispalyed is still 'Chris'. 

 

If I was to restart the application then the value would be displayed as 'Gary'. Currently I have resolved this by doing a Instance.RefreshLoadedViews() in the company chaged event. However there surely must be a better way of resolving this. I even tried binding the user control  but some how got an error "An error has occured! Please close the application' Have not debugged this further,  can u give me some examplke of binding a dropdown box to a company field.

 

Thanks

Satyajit

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Custom Field not refreshing

If you're setting the value programmatically you need to call the update method for the company.

Matthew Wood
Act! SDK Support
Community Moderator
Solution
Accepted by topic author satyajit_singh
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 18
Country: United_Kingdom

Re: Custom Field not refreshing

Yes I am calling the update function to fore the value to be stored. The issue is not woith storing the value, it is with retrieving the latest value stored. For e.g if I first went into the company deatil view for a company record whose SOCA Owner was 'Chris' the val;ue displayed in the dropdown would be 'Chris'. However if I change it to 'Gary', the database is updated with this value but if I navigate to another company and then navigate back to this company the value dispalyed is still 'Chris'. 

 

If I was to restart the application then the value would be displayed as 'Gary'. Currently I have resolved this by doing a Instance.RefreshLoadedViews() in the company chaged event. However there surely must be a better way of resolving this. I even tried binding the user control  but some how got an error "An error has occured! Please close the application' Have not debugged this further,  can u give me some examplke of binding a dropdown box to a company field.

 

Thanks

Satyajit