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 Jun 13, 2022 4:10AM in General Technical Discussions

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!