cancel
Showing results for 
Search instead for 
Did you mean: 

calling get price from apex trigger

Fry Chef
Fry Chef

calling get price from apex trigger

Jump to solution

Hi,

as part of a project, the users create Work Order directly on the field.

The work order is entitled when it is synchronised with the server as it should happens. However we would like the user not to have to press the get price button for each and every workorder before issuing the quote.

As such we would like to know if it is possible to launch the get price from an Apex trigger. That way the prices on the workorder would be updated when the data synchronise.

Is there a way to make this happen ?

Thank you for your time

Message 1 of 5
1 Solution

Accepted Solutions
Employee
Employee

Re: calling get price from apex trigger

Jump to solution

I second Alex's comment. Get Price will work within the SFM context.

ServiceMax does have an older GetPrice which was trigger based and is no longer supported with all the new enhancements. If you only need to get price from the pricebooks (and not use contracts/warranty/discounts), you could enable it. I have seen that configuration in the settings.

Message 3 of 5
4 Replies
Roast Chef
Roast Chef

Re: calling get price from apex trigger

Jump to solution

I know it's possible to do through the browser:

SFM Transaction / Screen Designer / Page Events / After Save/Update / Event Type = JavaScript, Method = Standard GetPrice

Do not believe this would work with mobile syncing, however

Might be worth testing with Debug Logging turned on through SFDC, might see the query or method that calls it through Apex

So it is definitely possible because the ServiceMax app does it on the browser - just no easy way to see it because we cannot see their Apex code

Message 2 of 5
Employee
Employee

Re: calling get price from apex trigger

Jump to solution

I second Alex's comment. Get Price will work within the SFM context.

ServiceMax does have an older GetPrice which was trigger based and is no longer supported with all the new enhancements. If you only need to get price from the pricebooks (and not use contracts/warranty/discounts), you could enable it. I have seen that configuration in the settings.

Message 3 of 5
Highlighted
Community Manager
Community Manager

Re: calling get price from apex trigger

Jump to solution

Hello! We're have an upcoming Design Time on the new SFM Designer on July 10th - I thought you might all be interested!

See details here: Design Time: Designer 2.0

And if you RSVP yes or maybe on the page, I'll drop a calendar invite on your schedule!

Hope you'll join!


---
Check out my signature
- one of the cool new features of our community. Edit yours under "Personal Information".
Message 4 of 5
0 Likes
Employee
Employee

Re: calling get price from apex trigger

Jump to solution

https://userdocs.servicemax.com/ServiceMaxHelp/182/en_us/svmxhlp.htm#MFL/GetPrice.htm?Highlight=get%...

https://svmx--c.na6.content.force.com/servlet/fileField?id=0BE80000000LCP2

http://releases.servicemax.com.s3-website-us-east-1.amazonaws.com/Winter17/relnotes.pdf

You can have it fire on save of the SFM. Do this by setting the 'Before Save' action for the page properties (select the row with the page layout name). Select Javascript, then Code001.

Note:  If the user is allowed to override the price manually using the Get Price feature on Save, this is a one-time action and it will always revert back to standard or contract pricing.

Message 5 of 5