Highlighted
Employee
Employee

Validate Address on Location

Jump to solution

One of my customers is going to create the Locations via their ERP system and they want to know if there’s an easy way to call “Validate address” on ‘Create’ so the Locations Latitude and Longitude coordinates are automatically updated when the Location record is created by the ERP system.   Is the easiest way to create a trigger that calls the COMM_validateAddress with the parameters below?

https://svmxc.cs10.visual.force.com/apex/COMM_validateAddress?zip=SVMXC__Zip__c&objName=SVMXC__Site_...

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Everyone,

I submitted a ServiceMax Product idea for this that you can vote for here

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

Thanks,

Mike

View solution in original post

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

COMM_validateAddress visual force page relies on Javascript/Google API to resolve coordinates; This page can't be invoked directly from Apex. Here is a post which explains options to invoke the Google API from Apex:  Geocoding in APEX Triggers, Callouts and Future methods | Bryan – Salesforce Development

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Perfect!!  Thanks, Shyam. Calling the API directly is exactly what I need to know.    #location‌

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

anand.kirtikar‌ Has anyone on your team already wrote a trigger that does this??  #location‌

Thanks,

Mike

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

anand.kirtikar Has anyone on your team already wrote a trigger that does this??

deanna.savon

Thanks,

Mike

#location‌

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

anand.kirtikar

I think we did this at one point for Service Experts, but that was before the change to Google maps.

mike.monin

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

anand.kirtikar‌ - and if those Google map API changes would have any impact ...

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

mike.monin‌ we have done this for few of our customers.

bala.murali‌  please share the code with Mike...

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

mike.monin‌ We have configured this in two ways. One way is Geocoding via trigger and another one is Geocoding via scheduled batch class. I think you know the SFDC Governor limit, we cant make more than 10 callouts in a single request, so if customer uploading more than 10 records at a time then Geocoding via trigger will fails, we suggest Scheduled batch class route. Please let me know what is your expectation.

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Thanks bala.murali‌.   I like the schedule batch class route.  I will send you an email to get the code.  :-)  #location‌

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Mike,

Were you able to get the code for this?

Highlighted
Fry Chef
Fry Chef

Re: Validate Address on Location

Jump to solution

No, I haven't been messaged about example code yet.

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

0 Likes
Reply
Highlighted
Line Chef
Line Chef

Re: Validate Address on Location

Jump to solution

I have this same issue - can I please get the code for the schedule batch class route?

Thanks!

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Bala Murali

Can you please send me the code as well? 

Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

0 Likes
Reply
Highlighted
Fry Chef
Fry Chef

Re: Validate Address on Location

Jump to solution

I am also looking for this same trigger/code for my implementation.

If you can share via git or something like that, that would be very helpful!

Thanks,

Bobby

#location #lalong

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

0 Likes
Reply
Highlighted
Employee
Employee

Re: Validate Address on Location

Jump to solution

Everyone,

I submitted a ServiceMax Product idea for this that you can vote for here

The code is not officially part of the ServiceMax Product since it is a ServiceMax Professional Services customization and therefore it would also not be supported by ServiceMax without having a statement of work in place (since we are liable for it too).  However, we can share configuration details for anything that is out of the box (part of the ServiceMax Product).  I would reach out to your ServiceMax Account manager.

Thanks,

Mike

View solution in original post

0 Likes
Reply