Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Admin
Admin
Posts : 122
Join date : 2018-12-17
https://mattersphere-devs.forumotion.com

Error on Associate Screen when adding email address Empty Error on Associate Screen when adding email address

Tue 29 Jan 2019 - 10:19
Original post by Mike Vaughan

Hi, in our script we check to see if an associate has an email address and if not they are prompted to add the email address. The following code opens the associate screen

Code:
FWBS.OMS.UI.Windows.Services.ShowAssociate(assoc);

I click add to add a Default Email for the associate and it is added into the field ok, but when I click save I get the following error...

Code:
Object reference not set to an instance of an object.-== Diagnostics Information ==-### UserName : Mike VaughanUser ID : 567Date/Time : 02/12/2009 10:48:27Computer Name : MC-FWBS06-=OMS=-Database Version : 4.0.0.5Engine Version : 4.0.0.25-=Message=-Object reference not set to an instance of an object.-=Stack Trace=- at FWBS.OMS.Associate.ToString() at FWBS.OMS.UI.Windows.frmOMSType.Save() at FWBS.OMS.UI.Windows.frmOMSType.cmdSave_Click(Object sender, EventArgs e)###I click ok on the error and when I click the main OK button on the screen I then get this errorProperty 'defaultAddress' on object type 'FWBS.OMS.Associate' cannot be invoked on enquiry form 'SCRASSEDIT'.-== Diagnostics Information ==-###UserName : Mike VaughanUser ID : 567Date/Time : 02/12/2009 10:49:40Computer Name : MC-FWBS06-=OMS=-Database Version : 4.0.0.5Engine Version : 4.0.0.25-=Message=-Property 'defaultAddress' on object type 'FWBS.OMS.Associate' cannot be invoked on enquiry form 'SCRASSEDIT'.-=Inner Message=-[TargetInvocationException]Exception has been thrown by the target of an invocation.-=Inner Message=-[InvalidCastException]Specified cast is not valid.-=Stack Trace=- at FWBS.OMS.EnquiryEngine.Enquiry.Update() at FWBS.OMS.UI.Windows.EnquiryForm.UpdateItem() at FWBS.OMS.UI.Windows.ucOMSTypeDisplay.UpdateItem() at FWBS.OMS.UI.Windows.frmOMSType.cmdOK_Click(Object sender, EventArgs e)###

I have to click Cancel and not save to close the form. When I then check the associate screen manually the email is not set as default in the drop down but it does appear in the drop down. Any ideas on why this is happening? thanks

-----------------------------------------------------------------------------------------------------------------------------------------------------------
Original post by Mike Walker

There are a number of things here. The "defaultAddress" Property is likely to be "Readonly" as it resolves itself looking at the base contact, this is from memory so maybe wrong. If you try and add the email in the Associate Edit window on the Associate Search list then you can confirm if there are other things at fault here. Have you got any extended data or other changes to the Associate Edit Screen. Can you package up the script into a reproducible form, I would then suggest you raise a support request on this so we can look into this a little further. It maybe the Telephone numbers/Email controls are updating out of order from normal usage and this is causing a problem. Another scenario is in word write a letter and then edit the current associate and try and an email address in there and click save. This should be the same logic as what you are trying and if this works we need to look more at the code behind this. Regards

-----------------------------------------------------------------------------------------------------------------------------------------------------------
Original post by Mike Vaughan

I tried to edit the associate with no email address from the search list and it worked fine, and the default email was set correctly with no errors. The only changes I'm aware of that we have done to the associate edit screen is to remove the Role on the Associate Format drop down.In Word I created a letter and selected the associate Tab, clicked Edit and I could add an email with no errors. I also created a letter and clicked OMS View, Current Document, Current Associate Info and added an email address with no problem.The error only seems to happen when I call the Associate screen from script. I will contact your support this afternoon and direct them towards this thread.thanks

-----------------------------------------------------------------------------------------------------------------------------------------------------------
Original post by Mike Walker
Hi Mike That would be best but it does seem like there is something specific to the scenario as if this is working elsewhere within the system either we have some code handling this specific issue of storing the email or the environment or way you have constructed the object is causing the ORN Regards
Back to top
Permissions in this forum:
You cannot reply to topics in this forum