Accessing Creatio SQL View through Creatio Odata

Hello,

I was trying to Create a random SQL View in Creatio Cloud and wanted to check if I can access it's records through Creatio Odata API. I followed below steps.

    1. Created  below simple SQL view in Creatio to display account and their annual revenue. 
    

IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[UsrVwAcctRevenuesT]'))
            DROP VIEW [dbo].[UsrVwAcctRevenuesT]
            GO 
            CREATE VIEW [dbo].[UsrVwAcctRevenuesT] AS
            SELECT Account.Id AS UsrId, AccountAnnualRevenue.Name AS UsrRevenue
            FROM Account  LEFT OUTER JOIN AccountAnnualRevenue  ON 
            Account.AnnualRevenueId = AccountAnnualRevenue.Id
            GO
   

        

    
    2.  I created new object in Creatio with same name (UsrVwAcctRevenuesT) as that of my SQL view with columns as "UsrId" (GUID datatype) and  "UsrRevenue" (TEXT data type with 50 chars) and kept same title.

 

    3. I marked above object as "Represents Structure of Database View" and set Id as "UsrId"
    
    4. Saved, published and compiled above new object.
 

But now when I tried to access it from Creatio Cloud through odata using below URL, 
https:///0/odata/UsrVwAcctRevenuesT
 

I am getting below error.

 

{"error":{"code":"","message":"An error has occurred.","innererror":{"message":"The 'ObjectContent`1' type failed to serialize the response body for content type 'application/json; odata.metadata=minimal'.","type":"","stacktrace":"","internalexception":{"message":"42P01: relation \"public.UsrVwAcctRevenuesT\" does not exist","type":"","stacktrace":""}}}}

 

Am I missing anything ?

Thanks.

 

Like 0

Like

1 comments

Hello!

 

To resolve the issue, please try to do the following:

  1. 1) Navigate to the configuration
  2. 2) Generate source code for all schemas
  3. 3) Compile the application
  4.  

Have a nice day!

Show all comments