Tuesday, February 13, 2024

Simple Queries

 Basic Simple Query


1st query:

I retrieved the Account Number from Custtable and Zipcode from LogisticsPotalAddress,

In INMF entity


SELECT CUSTTABLE.ACCOUNTNUM, LPA.ZIPCODE FROM CUSTTABLE
JOIN DIRPARTYTABLE on DIRPARTYTABLE.RECID = CUSTTABLE.PARTY
JOIN LOGISTICSPOSTALADDRESS AS LPA ON LPA.LOCATION = DIRPARTYTABLE.PRIMARYADDRESSLOCATION
WHERE CUSTTABLE.ACCOUNTNUM = 'INMF-000001'



2nd Query:  

I retrieved the Account Number from Custtable and Primary Contact Phone from DirpartyTable,

In INMF entity


SELECT CUSTTABLE.ACCOUNTNUM, DIRPARTYTABLE.PRIMARYCONTACTPHONE from CUSTTABLE
JOIN DIRPARTYTABLE on DIRPARTYTABLE.RECID = CUSTTABLE.PARTY
WHERE CUSTTABLE.ACCOUNTNUM = 'INMF-000001'




3rd Query: 

I retrieved the PurchId,  PurchName from PurchTable, accountnum from Vendtable, ItemId from PurchLine and Locator from LogisticsElectronicAddress, from USMF entity.


SELECT PURCHTABLE.PURCHID, PURCHTABLE.PURCHNAME, VENDTABLE.ACCOUNTNUM, PURCHLINE.ITEMID, LEA.LOCATOR FROM PURCHTABLE
JOIN PURCHLINE ON PURCHLINE.PURCHID = PURCHTABLE.PURCHID
JOIN VENDTABLE ON VENDTABLE.ACCOUNTNUM = PURCHTABLE.ORDERACCOUNT
JOIN DIRPARTYTABLE ON DIRPARTYTABLE.RECID =VENDTABLE.PARTY
JOIN LOGISTICSELECTRONICADDRESS AS LEA ON LEA.RECID = DIRPARTYTABLE.PRIMARYCONTACTPHONE
WHERE PURCHTABLE.PURCHID = '00000041'




Hope this info is useful to you....🙂 Thanks for the Visit....👍

No comments:

Post a Comment

Retriving the data through Dynamics Query in D365 F&O

 Dynamics Query We use classes to write the Dynamics Queries, dynamic  query that can be used to retrieve data from the database. So, in sim...