Call External URL from Workflow

I have a customer who wants to call an external url from a workflow action passing in some query string parameters. I created a new workflow action which calls a custom asp page. This custom asp page uses javascript to call window.open which opens up the external url in a separate window. I then update the oppo record's stage as well as the work flow instance's currentstateid. All of this works great, but I have 2 issues. One, the workflow history doesn't get created when I change the workflow instance. I guess I should have expected that, but I was curious as to how I would create the workflowhistory. I can call the CreateRecord method and save it, but I'm not sure what the TransitionId should be. Not sure where that value comes from. The other problem is, once I close out of the new window that popped up and I go back to the crm screen it shows a blank screen. I tried using Response.Redirect to take me back to the Oppo Summary screen but when I do that it never pops up the new window. Does anyone have any suggestions on how to handle this? It would be nice to be able to pop up the new window and when I go back to the crm screen show the workflow progress window which would allow the user to put in a tracking note and advance the worfklow state. Is that possible? How do you call up the workflow progress screen? Thanks.

  • 0

    Hi,
    As per your above post what I can understand is that you want to open Opportunity Workflow Progress screen as well as Open new page in Popup window. To achieve this functionality you can follow below given steps.

    1) Logged into Sage CRM

    2) Go to Administration | Customization | Secondary Entity | Opportunity Progress | Screen

    3) Create New Opportunity workflow Progress Screen by clicking on New button

    4) Add Required column in above mentioned screen

    5) Go to Administration | Advanced Customization | Workflows | Opportunity Workflow

    6) Click on Edit workflow button

    7) Click on <Workflow Rule > button

    8) Enter Custom Asp Page path in Custom File Name field

    9) Click on save button

    10) Click on Activate Workflow button

    11) Open Custom Asp Page file into Notepad or Notepad++

    12) Write a JavaScript code to open on Page Load.

    13) Using eWare.GetBlock() method call

    (Opportunity workflow Progress , Opportunity Progress Note Box) on screen

    14) After clicking on Save button kindly follow the below given steps

    a. Create new record into Opportunity Progress entity

    b. Handle Workflow Progress entry

    i. Fetch Opportunity Workflow id from Workflow Entity

    ii. Based on Workflow id fetch Workflow State id from Workflow State entity

    iii. Based on Workflow Id and State id fetch Top 1 Workflow Transition id

    from vWorkflowTransition view

    iv. Add new entry into Workflow Instance entity

    v. Add new entry into Workflow History entity

    vi. Update new Workflow Instance id into Opportunity Workflow id field

    c. Navigate user to Opportunity Summary Screen

    Hope this helps!
    Regards,
    Dinesh
  • 0

    Hi Dinesh,

    Thanks for the quick response. I was able to figure out most of this except for steps 14a and 14bv. I was using the out-of-the-box OpportunityProgressNoteBox, but when I clicked Save it didn't do anything. I didn't realize that I actually had to create the OpportunityProgress Record so I'll work on that. Can you explain how to get the values from the screen to save into the OppoProgress record? I'm unfamiliar with that. Also when I try to create the WorkflowHistory record I can't for the life of me figure out what the TransitionId is. Where do I get this value? Once I have those 2 things figure out I think I'm golden. Thanks so much for your help Dinesh.

  • 0

    Okay Dinesh, I see from some examples that I probably need to use Request.Form to get the values from the form. Is that correct? Thanks.

  • 0
    Hi,
    Please find below given details for your reference.

    1) Opportunity Progress Duration and SLADateUpdated fields: As per your above post I came to know that you have created .ASP page to handle the entries. If you are refereeing eWare.CreatedRecord (“OpportunityProgress”) method then Duration and SLADateUpdated value will automatically get updated.

    2) Workflow Transition ID: As explained in above post you can fetch top 1 Transition id from vWorkflowTransition view based on Workflow Id and State id. With the help of view you will get opportunity workflow current stage Transition id.

    3) Workflow History: Workflow History entity is used to maintain opportunity workflow progress of all stages.

    Hope this helps!
    Regards,
    Dinesh
  • 0

    Hey Dinesh,

    So I changed the save functionality to create the OpportunityProgress Record but I also noticed that the record before that one doesn't get the Duration and SLADateUpdated fields updated. Does that mean I have to update the last record in the OpportunityProgress table for that opportunity or is there something I'm missing? And what is the purpose of the workflowhistory table? Thanks Dinesh.