Well, Modifying the UI of POS form is bit difficult, it is easy if you follow the steps which i have published.
First, Select the main table layout from the form. click on right top most arrow icon
Next, Click on Edit Rows and Columns and increase the row size to 800-1000 so that you can add new rows. and note that you have to set to autosize after adding the controls to the rows. Add required new rows, set the row to Absolute as 30 size. and drag required controls into the form and set Cell property of that control to the required row. and after your modification done set the contols and tablelayoutpanel from Absolute size to Auto Size.
I have dragged some controls into customer form and that looks like ,
After that create some new fields in AX Database and POS database.
Notice that, According to my research we cannot update the Microsoft.Dynamics.Retail.Pos.Contracts.dll to get the newly created fields to call in our code. To insert the record with new fields we need to get the Customerid and write the update method in AX and call that in .NET. Here am Updating the three checkboxes in Primary and two checkboxes in OptIn
To get the customer ID we need write a int in SaveCustomer() method
int custid = Customer.CustomerId
and in AX, create a method in RetailTransactionServiceEx as CustomerUpdate and write the code as following
public static container CustomerUpdate(AccountNum party,Boolean storeEvent, Boolean newsLetter, Boolean phone, Boolean email, Boolean url)
{
CustTable custTable;
container result = [false, ''];
DirPartyLocation locationPhone, locationEmail, locationURL;
LogisticsElectronicAddress logisticsElectronicAddress;
boolean updated = false;
if (party)
{
ttsBegin;
select forupdate custTable where custTable.AccountNum == party;
if (custTable)
{
custTable.DVFOptInInStoreEvent = storeEvent;
custTable.DVFOptInNewsletter = newsLetter;
custTable.update();
select forupdate locationPhone where locationPhone.Party == custtable.Party join logisticsElectronicAddress
where logisticsElectronicAddress.Location == locationPhone.Location
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone;
if(locationPhone)
{
locationPhone.IsPrimary = phone; locationPhone.validTimeStateUpdateMode(ValidTimeStateUpdate::CreateNewTimePeriod);
locationPhone.update();
}
select forupdate locationEmail
where locationEmail.Party == custtable.Party
join logisticsElectronicAddress
where logisticsElectronicAddress.Location == locationEmail.Location
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email;
if(locationEmail)
{
locationEmail.IsPrimary = email;
locationEmail.validTimeStateUpdateMode(ValidTimeStateUpdate::CreateNewTimePeriod);
locationEmail.update();
}
select forupdate locationURL
where locationURL.Party == custtable.Party
join logisticsElectronicAddress
where logisticsElectronicAddress.Location == locationURL.Location
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::URL;
if(locationURL)
{
locationURL.IsPrimary = url;
locationURL.validTimeStateUpdateMode(ValidTimeStateUpdate::CreateNewTimePeriod);
locationURL.update();
}
ttsCommit;
result = [true, 'Success!', custTable.name()];
}
else
{
updated = true;
result = [false, 'Customer not found'];
}
}
else
{
updated = true;
result = [false, 'accountNumber is null.'];
}
if(updated)
{
ttsBegin;
custTable.delete();
ttsCommit;
}
return result;
}
and to call this method in AX.
Pos.Customer.Customer.InternalApplication.TransactionServices.InvokeExtension("cgsCustomerUpdate", AccNo, storeEvent, newsLetter, primaryPhnNum, primaryEmail, primarySite);
the created Method is:
public void CgsUpdateCustomer(string AccNo, bool storeEvent, bool newsLetter,bool primaryPhnNum, bool primaryEmail, bool primarySite)
{
try
{
var response = Pos.Customer.Customer.InternalApplication.TransactionServices.InvokeExtension("cgsCustomerUpdate", AccNo, storeEvent, newsLetter, primaryPhnNum, primaryEmail, primarySite);
}
catch (Exception ex)
{
LSRetailPosis.ApplicationExceptionHandler.HandleException(this.ToString(), ex);
Pos.Customer.Customer.InternalApplication.Services.Dialog.ShowMessage(Convert.ToInt32("Unable to create the customer"), MessageBoxButtons.OK);
}
}
and call this method in SaveCustomer() method
CgsUpdateCustomer(Customer.CustomerId, storeevent, newsletter, PhnChk, Emailchk, Sitechk);
To get the storevent,newsletter,PhnChk etc....
bool storevent = false;
if(chkStoreEvent.checked == true)
{
bool storevent = true;
}
etc....
Then generate a dll of Customer Class Library and paste the dll in C:\Program Files\Microsoft Dynamics AX\60\Retail POS\Services and run the POS Application.
Hi
ReplyDeleteWe have successfully setup our Retail POS for AX 2012 successfully.. now we need another version of POS to be setup for capturing huge number of Orders for the Schools(we have to capture order for students in all grades). Each school has 1000's of students so our business decided to select the Customer at initiation of first transaction not to clear the Customer from the transaction till we capture the orders for all the pupils in that School.. so My question is How do i tell the POS to not clear the Customer details after the transaction is concluded...
I was thinking of using PreCustomerClear Trigger but not getting idea what to write under this trigger..
Please help me..
Thanks Venu Gopal! I really appreciate your comment. Try to add a reference of customer.dll to CustomerTrigger Project and add a logic of selecting a default customer in the PreCustomerClear and PostCustomerClear methods. Hope it will help you...
DeleteThanks,
Raghunath Rao
Thank you Very much for instant reply Raghunath.. I am going to try now.. If I get any doubts I am gonna post it here if you don't mind.. If you have sample code which you can send me I will be very thankful and appriciated Raghunadh
Deletefriends , i want to customize the AX 2012 POS picking and receiving form , can any one guide me i am new in ax 2012 development.
ReplyDeletemainabid1978@gmail.com
0092-3434726428
Hi Abid Ali, Can you explain what kind of Customization you are going to do.? Before starting the customization keep in notice that you are flexible with .NET Windows Designing with table structure. If you have any db Transactions write a method in AX Transaction Service and call that method in .NET Code. To call the method in .NET
ReplyDeletePos...InternalApplication.TransactionServices.InvokeExtension("MethodNameFromAX", Param1, Param2, etc..);
Please let us know if you are facing any issues.. Thanks
HI, I am looking to customize the AX POS 2012 R3 Picking and receiving form to be able to pick more than ordered items and non ordered items.
ReplyDeletecan anyone guide me
Chand
shaik_chan@hotmail.com
Hi Raghunath,
ReplyDeleteThanks for the blog, it gave me lot of info, even its old.
I'm required to add new fields such as mobile no, City.., in Loyalty Card.
Above fields are entered at the time of creating the loyalty card, but optional
I have added a method loyaltyupdate in RetailTransactionServiceEx class
as per technet.microsoft.com/.../dn126098.aspx
I called the update method from the commerce runtime.
I'm stuckup at next step to saveloyalty, i couldn't find such as "Savecustomer" method to call my method.
Could you pls. guide me.
Thanks.