10-12-2011 05:37 AM
I have the Below Issue which is Really Killing Me from last Few Days.
For Deletion of Accounts in SLX Web we did a Soft Delete Mechanism where we are Changing the owner to Delete Team if any user other than admin deletes an account. So we have also a Button which is Visisble only to admin where admin can see for deleted accounts by any other user.
Every thing is Working fine except the Refresh issue.
When User MOves to Detail View of a Deleted Account we have a Label Marking this is a Deleted Account. But this will only Appears to the Admin when we did Refersh for more than 8 Times. We have following Code on Page Load of Acocunt Details but still Doesn't Work Please Suggest
WebEntityBinding OwnerLookupResultValueBinding = new Sage.Platform.WebPortal.Binding.WebEntityBinding("Owner", Owner, "LookupResultValue", "", null);
IPanelRefreshService refresher = PageWorkItem.Services.Get<Sage.Platform.WebPortal.Services.IPanelRefreshService>();
if(refresher != null)
IAccount account = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount;
SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();
IUseruser = usersvc.GetUser();
stringusername = user.UserName;
if ((username == "ADMIN") && (Owner.Text == "Delete Team"))
undeletebtn.Visible = true;
undelete_lbl.Visible = true;
undeletebtn.Visible = false;
undelete_lbl.Visible = false;
The Above Code Doesn't seem to be work because the Owner Look up is not getting refresh even though in the back end the seccodeid value is every one. It is Still Showing the Same Old Value for Owner and after refershing for 10 Times it is APpearing the New Value. Please Suggest
10-13-2011 09:48 AM - edited 10-13-2011 09:52 AM
Rather than using the controls, use the entity on the page instead. Something like this in the quickformload event should be all the code you need to do this:
Sage.Entity.Interfaces.IAccount a = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount;
undeletebtn.Visible = (Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser.UserName.ToUpper() == "ADMIN" && a != null && a.Owner.OwnerDescription == "Delete Team");
undelete_lbl.Visible = undeletebtn.Visible;