I have a custom action on the Sales Orders screen. If the order is a Quote and it has been saved, the user can click my custom action button and it will create a Quote PDF and attach it to the current record. The customer uses Acumatica ESign.
The next step is to get the user over to the ESign screen. I’ve tried two ways to do it.
- Redirecting the user to the File Maintenance screen and populate it with the Quote file. From there they could click the ESIGN button.
- Redirect the user directly to the ESign screen.
The 2nd option is preferred.
After the PDF is attached to the record on the Sales Orders screen, you CAN click Files at the top of the screen, then click the Edit link on the Files dialog. That will take you to the File Maintenance screen where you can click ESIGN.
My customer want a “one click” operation. That is why option 2 is preferred. But if that cannot be done, I will take option 1.
At the end of my “Create PDF Quote” action, I have the following code to create an instance of the File Maintenance graph, set the key field for the screen, and redirect the user to the screen.
PXGraph fm = PXGraph.CreateInstance<PX.SM.WikiFileMaintenance>();
fm.UID = file.UID;
throw new PXRedirectRequiredException(fm, true, "File Maint");
The File maintenance screen opens and the current file is some jpg file. I’ve no idea how that is being selected as the current record for the screen. In debug, I verified that the UID being assigned to the fm.UID is the actual Guid of the file that I can see when selecting it from the UploadFiles table. So I am certain I am setting the correct Guid value.
This is what comes up on the File Maintenance screen:
I checked the UploadFile table and that indeed is a real record in the table.
My second option which would be preferred is to open the ESign screen directly and save a step. I don’t know if this code would even work because I can’t get it to compile so I can test it.
I get the graph extension from the using AcumaticaESign.SM DLL. as follows:
PXGraph baseGraph = PXGraph.CreateInstance<WikiFileMaintenance>();
var extGraph = baseGraph.GetExtension<WikiFileMaintenanceESExt>();
UploadFileRevisionNoData rev = new UploadFileRevisionNoData();
rev.FileID = file.UID;
extGraph.RevisionsWithAction.Update(rev);
throw new PXRedirectRequiredException(extGraph, true, "ESign");
The throw new exception has an error on the extGraph. It says that it cannot convert from AcumaticaESign.SM.WikiFileMaintenanceESExt to PX.Data.PXGraph.
I’ve looked hard to see how to throw an exception to redirect the user to the “third party” screen but I cannot find anything.
In summary, is it possible to do a PXRedirectRequiredException to a graph extension? If not, what can I do to get my PXRedirectRequiredException to the File Maintenance screen to work?
Thanks in advance!
Best answer by Dioris Aguilar
View original