I have two different Data Extensions, one (let's call it A) has a primary key of Email Address, with an associated field of Preferred Store Number, and the second (B) has a primary key of Store Number, with fields of address, phone, hours associated with it.   Is it possible for me to lookup the store number associated with an email address from DE A within an email, but then in the body of the email, populate info from DE B?
122099
We have several data extensions that have data relationships with each other.  How can I send an email using one data extension while pulling data from a second data extension to personalize my email with ampscript?  I've tried Lookup in many different ways, but I've only managed to pull one specific row (the same row which is not personalized to each user) or all rows at once. I haven't been able to pull personalized data for each user.  In practice, I want to pull data from a DE called "Survey". Each user has a specific ID and some users have an "AnswerID", which varies. I want to to create IF/THEN statements based on that AnswerID.  Thanks, Sylvie
60682
I have the following QUERY  =query(XX!A2:A;" select A where A&gt;'50' ")   and  =query(YY!A2:A;" select A where A&gt;'50' ")   how do I combine these two data sources so I don't have to have two separate columns they process data to?   best would be if the 1st row from XX is followed by the 1st row of YY, 2nd row followed by 2nd row... and so on If the above option is not easily possible, it is OK for one query to be followed by the second one (if I expect correctly that the start of the second will be moved with newly added data into the first one)
122202
I have a requirement in which I have to create a custom lookup field on lead object which selects the account Account__c and during the lead to account conversion I have to map the field with 'Parent Account' field of the account which is a standard field.So i am trying to write the code on before insert trigger that maps the custom lookup field of lead to the standard field of account.  trigger populateParentAccount on Account (before Insert){     List&lt;Lead&gt; convertedLeads=[SELECT Id, ConvertedAccountID,Agency_account__c FROM Lead WHERE IsConverted=True AND ConvertedAccountId IN :trigger.new];     Map&lt;ID,ID&gt; acctParentMap=new Map&lt;ID,ID&gt;();      for (lead l: convertedleads){         acctParentMap.put(l.ConvertedAccountId,l.Agency_account__c);     }      for (account a:trigger.new){      if (acctParentMap.containsKey(a.Id)){       a.ParentId = acctParentMap.get(a.Id);       }     } }   But It is not working.. Please help..
74058
Currently, we use Subscriber key= Email Address = Contact Key; We are planning to use Salesforce Contact ID as Subscriber key/ContactKey. Is there a way to mass update Subscriber key value for all our current Subscribers (we have around 250k subscribers)? Also, will we lose all the tracking data about our subscribers? We are mostly concerned about Einstein Optimization data, but we are not sure if Einstein tracks and stores the data based on the Subscriber Key or email address?
55113
Let's assume we have a table where it has two columns, one an ID and one an hstore column, which stores key/value pairs.  You could query that column as such:  SELECT name, attributes-&gt;'device' as device FROM products WHERE attributes-&gt;'edition'= 'ebook'   Can you create a view for this table where the keys/values appear as columns in the view instead of all in the hstore column?  Example: I have an hstore key where it might have the key of amenity.  I want to create a view showing the the ID and the amenity values in a new view.
1222
there is two content types "country" and "state". content type "state" has entity reference field for "country".  there is another content type called "shop" which has two entity reference field for "country" and "state".   when i creating "shop" it display all the "state" .  but i want something like when user select one country, the corresponding states to the country should display.  how to do that help needed .
70567
Is there a way to reorganize the fields/attributes in a data extension?  I've added some extra fields that relate to other fields in that extension.   I haven't found a way to regroup those fields.
122382
ALTER TABLE [dbo].[REMINDER_EMAIL]  WITH CHECK ADD  CONSTRAINT    [FK__REMINDER_EMAIL__FACILITY_ID] FOREIGN KEY ( [FACILITY_ID] )   REFERENCES [dbo].[FACILITY] ( [FACILITY_ID] )  ALTER TABLE [dbo].[REMINDER_EMAIL] CHECK CONSTRAINT [FK__REMINDER_EMAIL__FACILITY_ID]
90062
I have Opportunity-lookup field on Opportunity (self),  Scenario:   Opportunity A if select Opportunity B using lookup then Opportunity B's same lookup field automatically populate with Opportunity A.   I tried to achieve this using trigger - before insert/update but its failing as:  System.DmlException: Update failed. First exception on row 0 with id 006G000000DHaBlIAL; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 006G000000DHaBl) is currently in trigger Oppy_before_INSUPD, therefore it cannot recursively update itself: []
35571
Can anyone help me out with this,    This is from a custom object " Quotation", The look up field " Main Driver" is a look up to Personal account object. The below fields are as well exists in the personal account. I need whatever value would be choosen in the main driver, automatically the below values will get pop up.  I amm trying to write a trigger for this, but just got stuck, Error showing as,      Error: Compile Error: Variable does not exist: Account.Age__c at line   7 column 17   How can i define the Account variable in the Quotation object trigger ?  trigger MainDriverRelatedFields on Quotation__c (before insert,before update) {      for(Quotation__c obj : Trigger.new){          if(obj.Main_Driver__c!=null) {              obj.AgeMainD__c=Account.Age__c;              obj.GenderMainD__c=Account.Contact_Individual_Gender__c;          }      }  }
80451
I have a collection of orders that were submitted to an internal ERP, which were processed and partially shipped.  The table hierarchy is as follows:   Order table contains OrderReference(PO), OrderID OrderItems table contains Product/Lot/Qty requested (OrderID is parentID that joins these tables) Shipping contains OrderReference(PO), ShippingID ShippingArchive contains Product/Lot/Qty that was shipped (ShippingID is parent that joins these tables)   I want to create a report that looks as follows:  OrderReference#  Order Requested / Shipped Items / Missing Pieces  PC/Lot/Qty    -   PC/Lot/Qty    - PC/Lot/Qty   I have used a temp table to get some of the data but I realize I'm taking the wrong approach. I should be able to do all of this with a single query, though it will seemingly be a bit complex.   I get held up when I try to think about how to join where pieces don't exist, and where to perform the mathematics in my sorting and filtering. Please help!  Sincere thanks :)
86473
I have three tables project, users and proj_user. The PK of proj_user table is the FK of project and users table's pk e.g.(project_id,user_id)  My question is, is it possible if the project_id and user_id's data is different  like project_id = '12345' and user_id = 'abc987'  Please reply  kind regards Vivek
5834
Take the representation of an Address, here below is a complete and very detailed implementation:    here instead is a quick implementation (which more or less contains the same fields, imagine all fields in the former are contained also in the second)    If I were to decide which is the closer to a normalized and academically correct one I'd say the first one, however if I were to start a project I would go with the second.  Do you agree with this consideration? And if yes, how does one deal with this fact?   start with an easy database and as soon as it is time improve it into a more normalized/academical database. start with something as close as possible to the academical database stick with the quick and dirty solution
56886
Our company sells products in Thailand.  However , now what they are doing is for a product , they have different prices in different regions and it is based on UOM or the region in which product is sold.  I need to create a combination of 4 fields as the primary key to determine price of a product.  By that I mean, if any of the field of 4 fields has a different value , then the existing combination.  A new price for the product will be stored.  How can I create such a key?
48569
I want to know why I should use an int as a lookup table's primary key instead of just using the lookup value as the primary key (which in most cases would be a string).  I understand that using a nvarchar(50) rather than an int would use way more space if it is linked to a table with many records.  On the other hand, using the lookup value directly would basically save us doing a join. I can imagine this would be a big saving if the join is always required (We're working on a web app so this counts quite a bit).  What are the advantages of using a int primary key (specifically for a lookup table) other than it being "the standard thing to do"?
98595
I have an account with account hierarchy setup and there is one Custom object &quot;Agreement&quot; added as related list on the account. When, I search an account with an account name on global search I want all related agreement records of that account as well as of all account comes under the account hierarchy, to be displayed after search. How to achieve this in Salesforce? For Example: There is an account'A' with child accounts A1, A2, A3 under Account Hierarchy. and there is a related object Agreement 'AG' on account 'A' and 'AG1', 'AG2', 'AG3' on Account A1, A2 and A3 respectively. Ideally, the relationship should look like below:                                           A-&gt;A1-&gt;A2-&gt;A3  (Account Hierarchy)                                                                                                       |  |   |   | -&gt; (Lookup relationship)                                             AG AG1 AG2 G3  (Agreement records of respective account)  So, now If I search on global search by account name of an account 'A' then it should give me list of all agreement records of account 'A' as well as 'A1', 'A2' and 'A3'. can anyone help to achieve this functionality? How to perform this exactly?
68396
I want a way to establish which columns in a given database are joined via PK/FK relationships. I can return the PK/FK information for a given table via   SELECT *   FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS cu  WHERE EXISTS (     SELECT tc.*      FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc      WHERE tc.CONSTRAINT_CATALOG = 'MyDatabase'           AND tc.TABLE_NAME = 'MyTable'           /*AND tc.CONSTRAINT_TYPE = 'PRIMARY KEY'*/         AND tc.CONSTRAINT_NAME = cu.CONSTRAINT_NAME); GO   but for a PK returned from such a query how do I establish the associated FK (assuming there is one)?  I know you can also get the referenced tables via:  SELECT CONSTRAINT_NAME = name,         FOREIGN_SCHEMA = OBJECT_SCHEMA_NAME(parent_object_id),         FOREIGN_TABLE = OBJECT_NAME(parent_object_id),         REFERENCED_SCHEMA = OBJECT_SCHEMA_NAME(referenced_object_id),         REFERENCED_TABLE = OBJECT_NAME(referenced_object_id)  FROM sys.foreign_keys WHERE OBJECT_NAME(referenced_object_id) = 'MyTable'; GO   but I am struggling now to get the explicit column references.  I am creating a script generator for QlikView. To generate the script I need the constraints and the associated links. I need all of the constraint information for any given column (if any).  I want to construct a database class that holds all the information for a given database. This class structure database.table.column.constraints will then be used to get the matches between different columns on PK/FKs.  Clearly some columns will have FKs only and in this case I also want to retrieve the PK information of the corresponding key; some will have only PKs and then I want the reverse. Some of course can have both.