Community
Showing results for 
Search instead for 
Do you mean 
Reply

Contact pop called from standalone exe

New Member
Posts: 7
Country: United Kingdom

Contact pop called from standalone exe

Hi,

 

I need to run UIContactManger.ShowContact() from a framework (only) application - not a plug-in.

 

Is this possible?

 

(i.e. can I get ActApplication instance without being a plugin?)

 

Many thanks.

Nickel Super Contributor
Posts: 441
Country: UK

Re: Contact pop called from standalone exe

Take a look at Kevins Middleware for ACT!, this provides ACT! record popping functionality (or at least the demo did Smiley Happy )

 

Tom

New Member
Posts: 7
Country: United Kingdom

Re: Contact pop called from standalone exe

Sorry to be dumb, where would I find that (cant get a google hit) ?

 

Thanks.

Nickel Super Contributor
Posts: 441
Country: UK

Re: Contact pop called from standalone exe

Here's the link http://www.middlewaresdkforact.com/ otherwise they can be contacted at support@v8software.com

 

Tom

New Member
Posts: 7
Country: United Kingdom

Re: Contact pop called from standalone exe

Hi, turns out the data marshalling plugin sample (using Remoting) is what I think I needed. However, here is strangeness - I cant get the "popup" to work within that environment (if you know the Service class in the "shared" project within the marshalling sample, the code below is grafted in there). It may well be I am doing something fundamentally wrong.

 

// ActApp is valid

 

// Set up some criteria ....

 

// Run the lookup and get the results

cLookup = framework.Lookups.LookupContactsReplace(lCriteria, true, true);

 

cList = cLookup.GetContacts(null);

 

// Missed out checkign code

Console.WriteLine(cList[0].FullName);            <======== This works fine, so I know I have a contact object

 

// Screen Pop v1

ActApp.UIContactManager.ShowContact(cList[0]);       <===== Does not throw exception, but does not change ACT! UI

// Screen Pop v2

ActApp.ApplicationState.CurrentContact = cList[0];      <===== Does not throw exception, but does not change ACT! UI

ActApp.UIContactManager.ShowDetailView();

 

 

Can anyone see what I might try next.

Many thanks.

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Contact pop called from standalone exe

[ Edited ]

After calling UIContactManager.ShowContact(ContactList(0)) what is the current contact?

 

-- jim durkin

 

Message Edited by jimdurkin on 10-01-2008 08:02 AM
New Member
Posts: 7
Country: United Kingdom

Re: Contact pop called from standalone exe

Sorry, I fixed it.

 

The issue was as described elsewhere on the forum - the remoting method is "executed" on the non-UI thread, so any call to teh UIContactManager wishing to effect UI chnages must be marshalled to the correct thread using ActApp.Invoke().

 

What confused me was that just traversing the contact collection, lookup object etc. was working fine and I had assumed all-or-none would owrk.

 

Using invoke works great.

 

Rgds.

Tuned Listener
Posts: 8
Country: United States

Re: Contact pop called from standalone exe

Would you be so kind as to post your corrected code?

 

Thanks!

 

Kim 

New Member
Posts: 7
Country: United Kingdom

Re: Contact pop called from standalone exe

I would, so bearing in mind it is based on the "Marshalling Data from a Plugin" sample from the SDK, I would imagine the bit you want would be the Service class in the CommonClasses assembly, which I renamed ContactService:

 

public class ContactService : MarshalByRefObject

{

    // Delegate - to marshal ShowContact onto the UI thread

    public delegate void MethodInvokerShowContact(Contact con);

 

    // Constructor for the service

     public ContactService(ActApplication app)

    {

        ActApp = app;

    }

 

     public void PopupContactFromNumber(string number)

    {

         ... set up lookup using criteria etc.

 

         cList = cLookup.GetContacts(null);

 

         ... check you have a valid cList with something in it etc. 

 

         // Do the popup, marshalling onto the correct thread

          object[] args = { cList[0] };

         ActApp.Invoke(new MethodInvokerShowContact(ActApp.UIContactManager.ShowContact), args);

    }

 

 

 Hope it helps you.

 

 

 

Copper Contributor
Posts: 70
Country: USA

Re: Contact pop called from standalone exe

[ Edited ]

Hi there.

 

If you go to http://MiddleWareSDK.com and download my free ACT plugin to remotely control ACT by Sage, you can do what you want with a VB6 program that contains nothing other than a Button on a form with the following 100% complete code:

 

Sub Command1_Click()
'===========================
'DETERMINE MIDDLEWARE FOLDER ---------- BTW Turn SMILEY FACES into Closing Brackets
'===========================
 PFP$ = Environ$("ProgramFiles")
 PFP$ = PFP$ & IIf(Right$(PFP$, 1) <> "\", "\", "") & "V8Software\"
'================================
'GIVE MIDDLEWARE SDK SOME DETAILS
'================================
 Open PFP$ & "TheirGUID.DAT" For Output As #1
'WRITE CHRIS HUFFMAN'S GUID TO FILE
'==================================
 Print #1, "086273c0-12cf-446e-9afe-f09164628d4d"
 Close
'==================================================
'TELL MIDDLEWARE SDK TO TELL ACT TO POP THE CONTACT
'==================================================
 Open PFP$ & "JobControl.txt" For Binary Shared As #1
 R$ = "CPOP" ' (Contact Pop)
 Put #1, 1, R$
End Sub

 

Cheers,
Kevin

====================

Kevin Ritch

CRM Solutions, Inc.

631 265-6356

KRitch@CRMsi.com

 

Message Edited by kritguy on 10-04-2008 07:07 AM