Updating The CurrentEntity for a Form in SalesLogix

Question: I’m trying to update the CurrentEntity for a form in SalesLogix with the following

//IOpportunityJob newOppJob = EntityFactory.Create<IOpportunityJob>();
//newOppJob.Save();
//CurrentEntity = newOppJob;
//Refresh();

When I do this I receive the error message “Property or indexer ‘SmartParts_OpportunityJob_OppJobForm.CurrentEntity’ cannot be assigned to — it is read only”

So then I tried this:

//IOpportunityJob newOppJob = EntityFactory.Create<IOpportunityJob>();
//newOppJob.Save();
//BindingSource.Current = newOppJob;
//Refresh();

But then I get the message “Object reference not set to an instance of an object.”

Am I doing something wrong? Can I update the CurrentEntity for a form?

Answer: Try using this:

IOpportunityJob newOppJob = this.BindingSource.Current as IOpportunityJob ;
newOppJob.Save();

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!