EBOI
7/2/2018 - 12:03 PM

Ticket po nazwie wniosku i ID klienta

Pozwala na dostęp do kopii roboczej utworzonej i uzupełnionej przez klienta.

SELECT *
  FROM [NAME_OF_DATABASE].[dbo].[EF_DraftPackage]
  WHERE [edp_Name] = 'NAME_OF_DRAFT'
  AND [edp_User_ID] = 'CUSTOMER_ID'
  
COPY [edp_ID] value

SELECT TOP 1 *,
  CAST([edf_Xml] as xml) as xml
  FROM [NAME_OF_DATABASE].[dbo].[EF_DraftForm]
  WHERE [edf_DraftPackage_edp_ID] = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' // [edp_ID]

SELECT TOP 1 [tc_ID]
  FROM [Eformularze].[dbo].[Ticket]
  WHERE [tc_DraftForm_ID] = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy' // SEARCH IN [edf_Xml] FROM PREVIOUS QUERY