From which table can the customer name be retrieved? - axapta

I want to retrieve the customer name. But in table CustTable there is no field for the customer name. From which table can the customer name be retrieved?

You can retrieve the name using the method name() in table CustTable.
Select the table CustTable and then pass on the result of the method name().
Example:
CustTable custTable;
select custTable where custTable.AccountNum == "YourCustomer";
info(custTable.name());

Related

Remove record from Database in Linq

My picture is :
I want to remove record from Tbl_Category table.
Tbl_category have childs and its child has child and .... to Tbl_File
How I can remove Tbl_Category records ?
Thank you
In Tbl_user , "username" is Primary key and the session username is :
string u = Session["Username"].ToString();
could you please help me to write the query ?
Try this query to delete category from category table object. categoryID is the id you want to delete from table
Tbl_Category category= dbContext.Tbl_Category.Single(x => x.CategoryID== categoryID);
if(category!=null)
{
dbContext.Tbl_Category.Remove(standard1);
dbContext.SaveChanges();
}
Also check the WillCascadeOnDelete() method on context is turned ON or OFF

Filter Product Name in RetailProductDiscount Form productLookup ax 2012

I need to add the field of ProductName filterable in the ProductLookup field in retailPeriodicDiscount form. It is strongly connected to EcoResProduct and I can't use any other lookup field or method.
So, I need to add the product name field to productLookup method. Any suggestions how to do it?
For the product name you have to add the field Name of the table EcoResProductTranslation .Add the table as a joined datasource to the query and filter it by the system language.
sysTableLookup.addLookupfield(fieldNum(EcoResProduct, DisplayProductNumber));
sysTableLookup.addLookupfield(fieldNum(EcoResProduct, SearchName));
sysTableLookup.addLookupfield(fieldNum(EcoResProduct, ProductType));
sysTableLookup.addLookupfield(fieldNum(EcoResProductTranslation, Name));
if (_groupMember.Category)
{
query = RetailGroupMemberLineQueryProvider::containedProductsQuery(_groupMember.Category, true /*includesubcategories*/, _dataAreaId);
}
else
{
query = RetailGroupMemberLineQueryProvider::containedProductsQuery(_groupMember.Category, true /*includesubcategories*/, _dataAreaId);
}
// add datasources and join
qbdsProduct = query.dataSourceTable(tableNum(EcoResProduct));
qbdsProductTranslation = qbdsProduct.addDatasource(tableNum(EcoResProductTranslation));
qbdsProduct.relations(true);
// range for system language
qbdsTranslation.addRange(fieldNum(EcoResProductTranslation, LanguageId)).value(SystemParameters::getSystemLanguageId());
sysTableLookup.parmQuery(query);

RelationShip Between DeliveryName Field In SalesTable in Dynamics AX

**I Need to retrive the DeliveryName Field From SalesTable..What is the relationShip Between them ??How Can i retrive the DeliveryName From SalesTable **
for the comments you want get DeliveryName from SalesTable but you need the relation between CustInvoiceJour and SalesTable.
The relation is CustInvoiceJour.SalesId == SalesTable.SalesId
Code:
Select DeliveryName from SalesTable where SalesTable.SalesId == CustInvoiceJour.SalesId;
DeliveryName is field on SalesTable - there is no special relation as this is plain text field.

How can i insert data from one table to another in symfony2 doctrine2

I have table called
tasks---id ,name,groupid
user----id,username , groupid
Now i have another table
userTasks with fields id,name, taskid , userid
Now i want that when the new user is created or persisted in database then
all the tasks with same groupid asuser should gets inserted in
usertasks table with taskid and userid
HOw can i do that
I am thinking of puting the logic in postFlush() event
But i don't know how doctrine first select and then insert the records in that table
If your do it just after of insert the data, instead inside postFlush function, could be more confortable and easy.
$om->persist($user);
$om->persist($task);
$om->flush();
$usertask = new UserTask($id, $name, $user->getId(), $task->getId());
$om->flush();
$om is the ObjectManager; EntityManager is deprecated in Doctrine last version.
If you want to use postFlush() function, maybe have to declare both id's as private variables to have the info.

matching fields in a database, ASP.net (VB)

In a table I have news posts with these fields:
Title
Content
OwnerID
And a users table
ID
Name
Surname
The OwnerID relates to the ID in the users table, how can I get the name of the user who's ID matches the OwnerID?
I'm writing a website in ASP.net (VB).
You would need to join the two tables together like this:
select users.Name
from news inner join users
on OwnerID = ID;
This query has no where clause to filter the results that are returned so this query would return all users who are associated with a news record. If you wanted to find users associated with a specific news record you would need to filter on the news title or content like this:
select users.Name
from news inner join users
on OwnerID = ID
where Title = 'Some Title';

Resources