Need to writeToDB before Webservice call

I have an expression based record type. And record expression uses a webservice to get the data. Everytime that webserivce expression is called, i want to write to DB with the few details for logging purpose.
a!writeToDataStoreEntity or a!startProcess can only be executed inside a saveInto on a Interface Component or as part of a Web API.
How can i write data to DB in such case?

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    Let me repeat my understanding from your question.
    You have a requirement to write some login details before anyone opens a record.
    With this understanding I am suggesting my answer.

    Most popular way nowadays is to map records page in SITE and we allow end user to directly land on SITE home page.
    But to accommodate your requirement I think you need to map a process model.

    Steps
    1. Map a process model in site home page.
    2. In process model start page provide a link to navigate to record.
    3. Clicking this link will trigger a sub process
    4. First node in sub process will have a call to Write to data store entity smart service and write your login data to DB
    5. Next node would be an interface having a link to Record. (Use hard coded http link to navigate to records)

    Doing this we are increasing number of clicks for end users but we can give it a try. We are using 2 links in this whole scenario where we can provide some information to user.

    Let me know your thoughts on this.

    Thanks!
    Mayur Mondhe
Reply
  • Hi,

    Let me repeat my understanding from your question.
    You have a requirement to write some login details before anyone opens a record.
    With this understanding I am suggesting my answer.

    Most popular way nowadays is to map records page in SITE and we allow end user to directly land on SITE home page.
    But to accommodate your requirement I think you need to map a process model.

    Steps
    1. Map a process model in site home page.
    2. In process model start page provide a link to navigate to record.
    3. Clicking this link will trigger a sub process
    4. First node in sub process will have a call to Write to data store entity smart service and write your login data to DB
    5. Next node would be an interface having a link to Record. (Use hard coded http link to navigate to records)

    Doing this we are increasing number of clicks for end users but we can give it a try. We are using 2 links in this whole scenario where we can provide some information to user.

    Let me know your thoughts on this.

    Thanks!
    Mayur Mondhe
Children
No Data