cancel
Showing results for 
Search instead for 
Did you mean: 

How to return to the record created using Custom Action?

Highlighted
Fry Chef
Fry Chef

How to return to the record created using Custom Action?

webservice static SVMXC.INTF_WebServicesDef.INTF_Response ConsolidateProformaLines(SVMXC.INTF_WebServicesDef.INTF_Response request)

    {

        Savepoint sp = Database.setSavepoint();

        string strPIId = '';

        SVMXC.INTF_WebServicesDef.INTF_Response obj = new SVMXC.INTF_WebServicesDef.INTF_Response();

        try

        {

            if(Test.isRunningTest())

                 strPIId = strWO;

            else

            {

                for(SVMXC.INTF_WebServicesDef.SVMXMap objSVXMMap : request.valueMap)

                {

                    if(objSVXMMap.key == 'SVMX_RecordId')

                        strPIId = objSVXMMap.value;

                }

            }

                 

            if(strPIId != '')

            {    

                    /////Business logic to insert e Proforma record -- say created record in ProformaID    

           }

            // Construct Success response, Update response object members

           

            obj.message = 'Proforma Updated successfully';

           

            obj.success = true;

           

            obj.messageType = 'INFO';

           

            return obj; // Return should be of INTF_Response type and

           

        }catch(Exception ex)

        {

            Database.rollback(sp);//If there is any error then rollback all transactions from DB

            // Construct Failure response, Update response object members      

            obj.message = ex.getMessage();

            obj.success = false;

            obj.messageType = 'ERROR';

            return obj;

        }       

    }

In the above webservice how to return to the newly created record Id(ProformaID) using Custom Action SFM?

Appreciate your help on this. Thanks!.

0 Likes
Reply