USE [EnVisage]
GO


declare @ClientId uniqueidentifier='063CDC27-D82D-47BA-860B-A01C0530C688'
delete from IntegrationCrm2Prevu where ClientInfoId='063CDC27-D82D-47BA-860B-A01C0530C688'

--Resource add/remove project number
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_initiative','System.Guid','ProjectNumber','AddResource','Add',null)
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_initiative','System.Guid','ProjectNumber','RemoveResource','Remove',null)

--scenario end date add and update
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'new_project','icmc_discoveryactualend','System.DateTime','EndDate','Scenario','Update',null)
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'new_project','icmc_discoveryactualend','System.DateTime','EndDate','Scenario','Add',null)

--scenario start date add and update
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'new_project','icmc_discoveryactualstart','System.DateTime','StartDate','Scenario','Add',null)
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'new_project','icmc_discoveryactualstart','System.DateTime','StartDate','Scenario','Update',null)

 --Resource add/remove team role
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_integratedteamrole','System.String','CoreTeam','AddResource','Add','CoreTeam')
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_integratedteamrole','System.String','CoreTeam','RemoveResource','Remove','CoreTeam')

--Resource add/remove stake holder
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_stakeholder','System.String','Email','AddResource','Add',null)
insert into IntegrationCrm2Prevu (ClientInfoId,Id,CRMEntityName,CRMFieldName,CRMFieldType,PrevuName,[PrevuEntityName],TriggerType,CRMDefaultValue)
values(@ClientId,NEWID(),'icmc_relationship','icmc_stakeholder','System.String','Email','RemoveResource','Remove',null)


