Question

Update Query

Hi Can anyone help me to convert this query in postgre ? 

 

-- Parameters of new landing page

DECLARE @editPageName nvarchar(250) = N'UsrContactGeneratedWebFormPage'; -- declare the name of the created schema

DECLARE @landingTypeName NVARCHAR(250) = N'Contact'; -- the type name of the landing

DECLARE @actionCaption NVARCHAR(250) = N'Contact form'; -- declare the type name for the landing in the section when creating a new record

 

-- Set system parameters based on new landing page

DECLARE @generatedWebFormEntityUId uniqueidentifier = '41AE7D8D-BEC3-41DF-A6F0-2AB0D08B3967';

DECLARE @cardSchemaUId uniqueidentifier = (select top 1 UId from SysSchema where Name = @editPageName);

DECLARE @pageCaption nvarchar(250) = (select top 1 Caption from SysSchema where Name = @editPageName);

DECLARE @sysModuleEntityId uniqueidentifier = (select top 1 Id from SysModuleEntity where SysEntitySchemaUId = @generatedWebFormEntityUId);

DECLARE @landingTypeId uniqueidentifier = (SELECT TOP 1 Id FROM LandingType WHERE Name = @landingTypeName);

 

-- Adding new Landing page variant to application interface

INSERT INTO SysModuleEdit

(Id, SysModuleEntityId, TypeColumnValue, UseModuleDetails, CardSchemaUId, ActionKindCaption, ActionKindName, PageCaption)

VALUES

(NEWID(), @sysModuleEntityId, @landingTypeId, 1, @cardSchemaUId, @actionCaption, @editPageName, @pageCaption)

 

Like 0

Like

3 comments

Hello,

 

Here's the script for PostgreSQL:

 

DO $$

DECLARE

v_editPageName VARCHAR(250) := N'ContactGeneratedWebFormPageV2';

v_landingTypeName VARCHAR(250) := N'Contact';

v_actionCaption VARCHAR(250) := N'Contact form';

v_pageCaption varchar(250) := (select "Caption" from "SysSchema" where "Name" =

v_editPageName);

v_generatedWebFormEntityUId UUID := '41AE7D8D-BEC3-41DF-A6F0-2AB0D08B3967';

v_cardSchemaUId UUID := (select "UId" from "SysSchema" where "Name" =

v_editPageName);

v_sysModuleEntityId UUID := (select "Id" from "SysModuleEntity" where

"SysEntitySchemaUId" = v_generatedWebFormEntityUId);

v_landingTypeId UUID := (SELECT "Id" FROM "LandingType" WHERE "Name" =

v_landingTypeName);

BEGIN

INSERT INTO "SysModuleEdit"

("SysModuleEntityId", "TypeColumnValue", "UseModuleDetails", "CardSchemaUId",

"ActionKindCaption", "ActionKindName", "PageCaption")

VALUES

(v_sysModuleEntityId, v_landingTypeId, true, v_cardSchemaUId, v_actionCaption,

v_editPageName, v_pageCaption);

END;

$$ LANGUAGE plpgsql;

 

We will also make sure to add this information to the corresponding guide.

 

Best regards,

Yuliya Gritsenko

Hi this is showing a lot error  I am referring to linked article : https://academy.creatio.com/docs/developer/application_components/landi….

Bhumika Bisht,

Hello, we confirmed that the script above is correct.

Please ensure that all of the other steps of the instruction were completed successfully.

 

Show all comments