Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4516 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello All,

I'm just dipping my feet in scripts and I've trying this for a couple of days, but can't figure this out.

I want to generate a pdf of an Estimate.

I have a layout called Estimate Worksheet (based on the Estimate Table with portal based on EstimateLineItem).

After filling out the Estimate Worksheet, I then want to go to my Estimate Printable layout (based on my EstimateLineItem table) and consolidate all the related line items for a particular Estimate, sorted (according to ItemCategory), and the generate a pdf.

I can do this manually, but I want to automate this. But I can't seem to find a way to make it find all the related EstimateLineItems records for the estimate. I think it has to be with my inability to make it galvanize line items related to the EstimateID.

I am sure this is a common maneuver but I can't seem to get my head around this!!

Any direction would be greatly appreciated.

Posted

Save records as PDF[Restore; No dialog;"invoice.pdf";Records being browsed]

Posted

Thank you FMP12 for your prompt response.

It worked, however, I would like it to print not the Estimate Worksheet layout in which I am, but in my "Estimate Printable" layout.

The Estimate Worksheet layout has a lot of objects not needed in the Estimate which will eventually go to the client.

The two layouts are based on different tables -- and I believe this is what is causing me grief.

If you can help me through this extra step, it would be greatly appreciated...

Thank you again.

Posted

Beein trying this in baby steps.

This is what I've got so far:

Go to Layout ["Estimate Printable" (EstLineItem)]

Perform Find [Restore]

Sort Records [Restore; No dialog]

Save Records as PDF [Restore; No dialog; "EstimatePrint.pdf"; Automatically open; Create email; Records being browsed]

This does what I want, but I have to manually input the number of the Estimate when I am taken to the Estimate Printable.

(ok, here I scripted in EstimateID = 89, just to see if it would do it.)

But I can't figure out how to populate this field with the current EstimateID that I am working on in the Estimate Worksheet.

Posted

If I follow you..

I want to print /email estimate # 89

so your code is really correct, just set the estimate # as a variable and then using perform find to findit.


/* make a variable of the estimateID number */

$EID =estimateID

Go to Layout ["Estimate Printable" (EstLineItem)]

/* your perform find should be your estimateID field = $EID */

Perform Find [Restore]

Sort Records [Restore; No dialog]

Save Records as PDF [Restore; No dialog; "EstimatePrint.pdf"; Automatically open; Create email; Records being browsed]

Posted

…I have a layout called Estimate Worksheet (based on the Estimate Table with portal based on EstimateLineItem).…But I can't seem to find a way to make it find all the related EstimateLineItems records for the estimate….

… how to populate this field with the current EstimateID that I am working on in the Estimate Worksheet.



/* make a variable of the estimateID number */

$EID =estimateID

FMP12 -

you're aware there is a script step called Go to Related Record?

Posted

Thank you all for your input.

Go to Related Record is what I tried initially, but for some reason it still gave me all the EstimateLineItems rather than just the related ones for the Estimate that I was working on. It might be something else that I was doing wrong.

FM12, I will try your suggestion when I return to work tomorrow. It sounds like something that I was looking for.

Looking forward to gaining confidence in scripting in the weeks ahead.

Thanks again all

Posted

Go to Related Record is what I tried initially, but for some reason it still gave me all the EstimateLineItems rather than just the related ones for the Estimate that I was working on. It might be something else that I was doing wrong. […] Looking forward to gaining confidence in scripting in the weeks ahead.

Then you might as well start doing it right ;)

When you use GTRR, make sure to check the Show only related records and Match current record only options. This should give you the related EstimateLineItems for the current Estimates record, no more, no less.

This topic is 4516 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.