postheadericon Afficher ses clients non visités…

Je vous propose de réaliser un tableau de bord ou une liste clible affichant la liste de ses clients non visités. Cela signifie qu’aucune action n’est programmée associée à la fiche.

1 – Créer cette vue dans la table Company (activer les options permettant de la rendre accessible depuis un groupe ou un rapport) :

CREATE VIEW vCustomerWithoutCommunication

AS

SELECT Person.*, Company.*, Address.* FROM Company

LEFT JOIN Address ON Comp_PrimaryAddressId = Addr_AddressId

LEFT JOIN Person ON Comp_PrimaryPersonId = Pers_PersonId

where comp_companyid not in

(select comp_companyid from company

inner join comm_link on comp_companyid = cmli_comm_companyid

inner join communication on comm_communicationid = cmli_comm_communicationid

where cmli_deleted is null and comm_status = ‘Pending’)

 and comp_type = ‘Customer’

and comp_deleted is null

2 – Création d’une liste basée sur cette vue

3 – Création d’un bloc utilisant cette liste en placant la condition SQL suivante : comp_primaryuserid = #U

 Le tour est joué !!!!




Laisser un commentaire