You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Verify that an association is established between two objects

Question
12
Views
0
Comments
edited Sep 29, 2018 7:18AM in UI Extensibility

Summary

I want to verify that an association is established between two objects when i click “save and close”

Content

I want to verify that an  association is established between two objects when i click “save and close”.

If the two objects not exist an association, the system will not allow the workspace to be closed.  But now the code does't work.

private void _recordContext_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
       _recordContext.RefreshWorkspace();
      IOrganization _org = _recordContext.GetWorkspaceRecord(RightNow.AddIns.Common.WorkspaceRecordType.Organization) as IOrganization;
            if (_org != null && _org.ID >= 0)
            {

                //through webservice to query whether the association is exis
                if (queryOrganizationEntityCount(_org.ID) <= 0)

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!