Quantcast
Channel: Dynamics User Group
Viewing all 15740 articles
Browse latest View live

AIF Web Service custom Username and password login

$
0
0

Hi All,

I am trying to activate synchronous AIF  and produce a salesOrder web service to call it in C#.NET. It is working fine by default network user logon but I need to logon to AX with another network user who is also valid in active directory and Dynamics Ax users whereas not logon to as current windows user. In the other word, I need to send UserName and Password to IIS and further to AX to authenticate. 

I think something has to be done in preparing address header(setEndpointUser()) but not sure!

This is my code which is read a record from salesOrder finely by default logon user in windows. I am new in IIS and no idea to how to send a username and password to AX.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

using SysColl = System.Collections;

using SysSvcmod = System.ServiceModel;

using SysSvcmodChan = System.ServiceModel.Channels;

using SysXml = System.Xml;

using AifSos = ConsoleApplication1.SO;

namespace ConsoleApplication1

{

    class ProgramClass

    {

        protected AifSos.SalesOrderServiceClient m_salesOrderServiceClient;

        static void Main(string[] args)

        {

            ProgramClass programClass;

 

            AifSos.SalesOrderServiceClient salesOrderServiceClient;

            try

            {

                salesOrderServiceClient = new AifSos.SalesOrderServiceClient();

                programClass = new ProgramClass(salesOrderServiceClient);

                programClass.SendMessage();

                Console.ReadKey();

            }

            catch (Exception excepn)

            {

                Console.Out.WriteLine(excepn.ToString());

                Console.ReadKey();

            }

        }

        protected ProgramClass(AifSos.SalesOrderServiceClient salesOrderServiceClient)

        {

            this.m_salesOrderServiceClient = salesOrderServiceClient;

        }

        protected void SendMessage()

        {

            AifSos.QueryCriteria queryCriteria;

            SysSvcmod.OperationContextScope operContextScope;

            try

            {

                operContextScope = new SysSvcmod.OperationContextScope(m_salesOrderServiceClient.InnerChannel);

                using (operContextScope)

            {

                this.prepareHeader("bc1", @"GBGNetwork\A.Karimzadeh", "PDA");

            queryCriteria = this.PrepareBody_QueryCriteria();

            this.CallAifSalesOrderService_Find(queryCriteria);

            }

            }

            catch (Exception excepn)

            {

                Console.Out.WriteLine(excepn.ToString());

            }

        }

        private void prepareHeader(string destinationEndpoint, string sourceEndpointUser, string sourceEndpoint)

        {

            this.setHeaderDestinationEndpoint(destinationEndpoint);

            this.setEndpointUser(sourceEndpointUser, sourceEndpoint);

            this.setHeaderMsgId();

        }

        private void setHeaderMsgId()

        {

            SysXml.UniqueId guidUniqueId = new SysXml.UniqueId(Guid.NewGuid());

            SysSvcmod.OperationContext.Current.OutgoingMessageHeaders.MessageId = guidUniqueId;

        }

        private void setHeaderDestinationEndpoint(string destinationEndpoint)

        {

            System.ServiceModel.Channels.MessageHeader messageHeader;

            messageHeader = System.ServiceModel.Channels.MessageHeader.CreateHeader("DestinationEndpoint",

            "http://schemas.microsoft.com/dynamics/2008/01/services",

            destinationEndpoint);

            SysSvcmod.OperationContext.Current.OutgoingMessageHeaders.Add(messageHeader);

        }

        private void setEndpointUser(string sourceEndpointUser, string sourceEndpoint)

        {

            SysSvcmodChan.AddressHeader addressHeader;

            SysSvcmod.EndpointAddressBuilder addressBuilder;

            SysSvcmod.EndpointAddress endpointAddress;

            addressHeader = SysSvcmodChan.AddressHeader.CreateAddressHeader("SourceEndpointUser",

            "http://schemas.microsoft.com/dynamics/2008/01/services",

            sourceEndpointUser);

            endpointAddress = new SysSvcmod.EndpointAddress(new Uri("urn:" + sourceEndpoint), addressHeader);

            addressBuilder = new SysSvcmod.EndpointAddressBuilder(endpointAddress);

            SysSvcmod.OperationContext.Current.OutgoingMessageHeaders.From = addressBuilder.ToEndpointAddress();

        }

        protected AifSos.QueryCriteria PrepareBody_QueryCriteria()

        {

            AifSos.QueryCriteria queryCriteria;

            AifSos.CriteriaElement[] criteriaElements;

            criteriaElements = new AifSos.CriteriaElement[1];

            criteriaElements[0] = new AifSos.CriteriaElement();

            criteriaElements[0].DataSourceName = "SalesTable";

            criteriaElements[0].FieldName = "SalesId";

            criteriaElements[0].Operator = AifSos.Operator.Range;

            criteriaElements[0].Value1 = "SO-005517";

            criteriaElements[0].Value2 = "SO-005517";

            queryCriteria = new AifSos.QueryCriteria();

            queryCriteria.CriteriaElement = criteriaElements;

            return queryCriteria;

         }

         protected void CallAifSalesOrderService_Find(AifSos.QueryCriteria queryCriteria)

         {

            AifSos.AxdSalesOrder axdSalesOrder;

            AifSos.AxdEntity_SalesTable axdEntity_SalesTable;

            AifSos.AxdEntity_SalesLine axdEntity_SalesLine;

            SysColl.IEnumerator enumerSalesTable, enumerSalesLine;

            int iCountLoops1 = 0, iCountLoops2;

            // Issue the Find.

            axdSalesOrder = this.m_salesOrderServiceClient.find(queryCriteria);

            // Loop through the results.

            enumerSalesTable = axdSalesOrder.SalesTable.GetEnumerator();

            while (enumerSalesTable.MoveNext())

            {

                ++iCountLoops1;

                axdEntity_SalesTable = (AifSos.AxdEntity_SalesTable)enumerSalesTable.Current;

                Console.Out.WriteLine(Environment.NewLine + "SalesTable[" + iCountLoops1 + "]: SalesId = " + axdEntity_SalesTable.SalesId

                + " , CustAccount = " + axdEntity_SalesTable.CustAccount + " , CustGroup = " + axdEntity_SalesTable.CustGroup);

                // Loop through the child rows.

                if (null != axdEntity_SalesTable.SalesLine)

                {

                    enumerSalesLine = axdEntity_SalesTable.SalesLine.GetEnumerator();

                    iCountLoops2 = 0;

                    while (enumerSalesLine.MoveNext())

                    {

                        ++iCountLoops2;

                        axdEntity_SalesLine = (AifSos.AxdEntity_SalesLine)enumerSalesLine.Current;

                        Console.Out.WriteLine(" ** SalesLine[" + iCountLoops2 + "]: LineAmount = " + axdEntity_SalesLine.LineAmount);

                    } // End loop: SalesLine (child)

                }

            } // End loop: SalesTable (parent)

         }    

    }

}


CIL error After DMF installation

$
0
0

Hi

 

Whenever I am generating CIL This error is showing , after the installation of DMF . I tried full compilation full CIL but it doesn't worked for me  ,Please suggest a solution .

 

Trace the Production order from which sales order

$
0
0

Dear All,

Item id : FG0001

Coverage Type - Requirement

Created two sales orders:

1) Sales order - 15

2) sales order - 10

Run the master scheduling,

Systems suggested the two planned production orders, converted to two production orders. Now i need to trace each production order from which sales order. Is it possible to trace, i need show the production report against sales order.

 

Thanks,

Nanjappa

 

Using Item numebr vs Product number

$
0
0

Hi,

I would like to know if there is a way ( other than customisation) to have product number as sequential number but Item # as a manual #. In my case i want to use manufacturer # as my item # but I want that item to be created from a product which will be released to all companies. Is there a way to do that? I know that i can also have a specific field in AX ( which one?) that I can use as a manufacture #. Any thoughts on this?

Sorting Of Tablebox Control

$
0
0

Hello members, First time posting to this site.

Using an old version of NAV. 4.0 (SP3)

I have a Tablebox control that is bound to the Service Header table. There are additional columns  in this control that are bound to variables which are set in the Form - OnAfterGetRecord trigger.

Because these values are not fields in the Service Header table, I cannot create new table keys to allow a sort by them.

 

I have a requirement to sort by one of these columns in the Tablebox. Is this possible ? 

Number series

$
0
0

Hi All ,

One of my client is asking the Journal / Document number series should be like as mentioned below.

CODE          Staring No                 Ending No.

 

GEN/13 - GEN-00001/2013......GEN- 99999/2013

GEN/14 - GEN-00001/2014......GEN- 99999/2014

GEN/15-  GEN-00001/2015......GEN- 99999/2015

What client is asking when user try to create the journal or document between 01/01/14-31/12/14 , then system should pick the code GEN/14 , number should update GEN-00001/2014......GEN- 99999/2014.

If the user is generating the document /Journal between 01/01/15-31/12/15 hen system should pick the code GEN/15 , number should update GEN-00001/2015......GEN- 99999/2015.

It should pickup automatically . What i mean to say is for example 2014 Financial year completed , but not closed( becuase we  need to do some adjustments ) and enter in to 2015 then system will pick up number series from this code GEN/15. 

As we all know even year completed i need to pass some entries in 2014 , then system should pick up the number series from code 2014.

Is it possible in Ax 2012 ? ( I know that this functionality is possible in NAV wihtout any customization.)

If yes , could you share your experience.

 

Thanks in advance.

how to add method which calculated sum of invoices in ax 2009 report

$
0
0

hi, i have problem , i have two tables(data sets) custinvoicejour and commissionstrans table, i joined(1:1) them by relations,with range in custinvoicejour (invoiceaccount) and range in commissiontrans(invoiceno).

but when i run the the report,and give the the required range,it show only one record of invoicenumber against invoiceaccount ,where i check the same query in sql server, it show me more than one records,so where is problem or mistake..

also some time give me correct result,but some time show wrong.

another question is that how to sum all invoice transactions against invoiceaccount in ax standard report, i read that i will be done through method,but to how create such method, and where ...

thanks...

 

Regarding form design

$
0
0

I have a form ,in that form ,i hav a button ,by clicking a sub form will open in the same parent form ,my requirement is that parent form should nt be used till sub form is opn,once closing the subform we can use the main form ,how to set the property or how to acheive it?


Navision developer 7 years

$
0
0

Hello!

I have been working on Navision development for 7 years now. I recently got job offer which i can work on oracle. Is it bad idea to leave Navision for good?

How Navision is as permanent career choice?

I need to make choice. By the way I have no experience in Oracle.

 

Thanks 

AX 2009 EXPENSE MANAGEMENT- Cash advance request

$
0
0

Hi,

I am trying to use the above module. I tried to open a new Cash advance request (from the client). The NEW icon is disabled.

I have done the setups in Expense management, but no luck.

 

regards

Thomas

how to add new method which calculate invioicetransicions in ax 2009 standard report

$
0
0

hi, i have problem , i have two tables(data sets) custinvoicejour and commissionstrans table, i joined(1:1) them by relations,with range in custinvoicejour (invoiceaccount) and range in commissiontrans(invoiceno).

but when i run the the report,and give the the required range,it show only one record of invoicenumber against invoiceaccount ,where i check the same query in sql server, it show me more than one records,so where is problem or mistake..

also some time give me correct result,but some time show wrong.

another question is that how to sum all invoice transactions against invoiceaccount in ax standard report, i read that i will be done through method,but to how create such method, and where ...

thanks...

How to Cancel or Delete a invoiced PO in AX 2012?

$
0
0

Hi to everyone,

How to Cancel or Delete a invoiced PO in AX 2012? its urgent ..I made some changes in AR parameters and i could delete Invoiced Sales Order, same i tried to AP parameters, I couldn find any,,,,,,

plz help...

Thanks in advance..!!!

Regards,

Alonso

1,2,3... Friday afternoon

$
0
0
In this topic only posts of pictures from numbers starting from 1...

No text allowed

Let's see how far we will come

I will start Big Smile

Entering Vendor code when creating a Purchase requisition?

$
0
0

Hi,

At the company I work at, when we create a requisition, we only get an option to enter the vendor code when we enter line items and we have to enter the vendor code for each line item.  Is there not a way in AX 2009 to choose the vendor near the beginning of the requisition creation so it defaults the same vendor for the whole requisition?

 

Thanks in advance for any help.

AX 2012- bank reconciliation: bank balance is not the same as ledger balance

$
0
0

Hi everyone,

We have two bank accounts, saying A and B. Somtimes we transfer fund from A to B or B to A. As you can see below that the bank balance is not equal to ledger balance and the different came from inter-account transactions.

All inter-account entries were posted under GL and legder type is bank. Can any one tell me why this happened and how to fix it? By the way, bank reconciliation under Cash and Bank Management is fine, just reconciliation- bank under General Ledger has problem.  

 


AX development validation

$
0
0

I am new to AX Development. Can you please  help me with a code/procedure that signals a user if  " Invoice Code AND Account Number" combination already exists in the database after he has input an already existing combination in a new line.and then sets focus on the textbox for the user to correct the duplication

 

NB>>>THE ACCOUNT NUMBER IS A DIMENSION(LedgerJournalTrans_AccountNum
LedgerJournalTrans(LedgerJournalTrans).LedgerDimension
AutoIdentification)

Ax technical regarding form

$
0
0

i have to execute a logic while closing a form by clicking  "X" button alone,where i have to write the code ,close() method?

i cant use closedok,it will execute while cliking ok button,so i cant use that method

Looking to buy/rent time in an AX Environment for Practice

$
0
0

I am taking several Dynamics AX Financials eLearning courses.  I am looking to buy or rent time in a Dynamics environment so I can practice the exercises in the eLearning material.  Microsoft's eLearning training courses don't give much software to pratice the configuration exercises that the courses explain.  So far, a lot of the training material is mostly lecture.  How can I really learn this if I can't practice it?  Amazon.com's cloud service rents out an SAP HANA environment for people to play with.  It's basically a sandbox.   Does anyone do this for Dynamics AX 2012?   

AX retails services (Sync service and Real Time service , Retail Schedular Job.

$
0
0

What is differences in

1) AX Retail Scheduler job - As I have heard, to synch data between AX and POS database. 

2) Dynamics AX for Retail Store Connect

3) Dynamics AX for Retail Transaction Service.

What does these services and job performed or actual use of these services.

Thanks.

SysGlobalCache & thread

$
0
0

Is it possible to access SysGlobalCache by thread ?

Viewing all 15740 articles
Browse latest View live