Archives

 

This is a complete code example that shows how to code the Web Services GetPricingByKey method

This is a simple example of the RadAjaxManager code that needs to go in a web page to 'Ajaxify' a control(s)

Almost every time that I have to manually write a connection string, I have to search www.connectionStrings.com for the right one. It's a good site, they do have the references, but for what I need it's overly complicated.

Below are the connection strings that I use daily    

In our SQL library we keep quite a few functions that get moved from project to project.

Today's example is the ddf_phone function. This function takes a phone number in the format of '12345678901234' and formats it to '(123) 456-7890 x1234'

That's the standard format in Dynamics GP

 

 

This script is worth the price of admission.

I continue to get requests for variations on the RM Aged Trial Balance report. The idea with an RM Aging is that you need to first get a query of all the documents (open and history, invoice and payment) and then get a query of the applies - carefully noting the apply date.

Then you can pick a point in time, get all docs prior to that date and apply all the applies prior to that date.

You have to handle trade discounts and writeoffs. These two we bundle as 'reductions'; they're not attached to the document but to the apply itself.

The query below is a variation to the usual theme, the client wanted a 'starting balance', 'ending balance', and all transactions in between.

The end result looks like this:

Enjoy!

As a VB developer, I'm always struggling with the constants that are used in Menus for VS Tools. I imagine that if you're a Dex developer they're more accessible, but that's not me.

The grid below is copied from the help file, and we'll add it it as we find new values. Please don't hesitate to drop us a line if you have any additions.

I am using GetItemByKey and I need to get the List Price for the item.  The pricing method is % List and there is only one price level assigned.  I am using GetPricingByKey.  I have assigned the keys and I get this far:

public static Pricing getIVPricing(int CompanyId, string itemNumber, string priceLevel, string uom)
{

PricingKey pricingKey;
Pricing pricing; 
 
//Get Web Service
DynamicsGPClient wsDynamicsGP = Globals.getWebServiceReference();

// Create a context with which to call the service
Context context = Globals.getContext(CompanyId); 
 
// Create a pricing key to specify the pricing object
pricingKey = new PricingKey();
pricingKey.ItemKey = new ItemKey { Id = itemNumber };
pricingKey.PriceLevelKey = new PriceLevelKey { Id = priceLevel };
pricingKey.CurrencyKey = new CurrencyKey { ISOCode = "USD" };
pricingKey.UofM = uom;

// Get the specified pricing object
pricing = wsDynamicsGP.GetPricingByKey(pricingKey, context); 
 
return pricing;
 

}
 

But then when I try get the amount..

pricing.Details[0].UofMPrice.Item

I get a conversion error involving a percent.  I understand that 'Item' is a MoneyPercentChoice and can handle this when updating or creating, but I am not sure what to do when trying to retrive the List Price amount.  Can someone help?  I am sure this is something easy I am missing.

Thanks,

Darren

Has anyone seen this before? Can't figure it out. It's in GP 9

Server was unable to process request. ---> Violation of PRIMARY KEY constraint 'PKIV00105'. Cannot insert duplicate key in object 'IV00105'.
The statement has been terminated.

<eConnect xmlns:xsi=

"http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<IVCreateItemPriceListType>
<eConnectProcessInfo xsi:nil="true" />
<taRequesterTrxDisabler_Items xsi:nil="true" />
<taIVCreateItemPriceListLine_Items>
<taIVCreateItemPriceListLine>
<ITEMNMBR>GALVANIZED~3-1/2X5~216</ITEMNMBR>
<CURNCYID>Z-US$</CURNCYID>
<PRCLEVEL>422525 </PRCLEVEL>
<UOFM>Each </UOFM>
<UOMPRICE>192.23</UOMPRICE>
</taIVCreateItemPriceListLine>
</taIVCreateItemPriceListLine_Items>
<taIVCreateItemPriceListHeader>
<ITEMNMBR>GALVANIZED~3-1/2X5~216</ITEMNMBR>
<UOFM>Each </UOFM>
<PRCLEVEL>422525 </PRCLEVEL>
<CURNCYID>Z-US$</CURNCYID>
</taIVCreateItemPriceListHeader>
</IVCreateItemPriceListType>
</eConnect

 

EConnect error executing taPoHdr: Invalid PO Line Status (POSTATUS) - line item(s) are not Closed (9204)

<?xml version="1.0"?>
<eConnect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <POPTransactionType>
    <eConnectProcessInfo xsi:nil="true" />
    <taRequesterTrxDisabler_Items xsi:nil="true" />
    <taUpdateCreateItemRcd xsi:nil="true" />
    <taUpdateCreateVendorRcd xsi:nil="true" />
    <taCreateVendorAddress_Items xsi:nil="true" />
    <taUpdateCreateCustomerRcd xsi:nil="true" />
    <taCreateCustomerAddress_Items xsi:nil="true" />
    <taPopIvcTaxInsert_Items xsi:nil="true" />
    <taPopDistribution_Items xsi:nil="true" />
    <taAnalyticsDistribution_Items xsi:nil="true" />
    <taPoLine_Items>
      <taPoLine>
        <POTYPE>1</POTYPE>
        <PONUMBER>PO2382</PONUMBER>
        <VENDORID>JENSENSY0001</VENDORID>
        <LOCNCODE>WAREHOUSE</LOCNCODE>
        <VNDITNUM>adfsadfa</VNDITNUM>
        <ITEMNMBR>A100</ITEMNMBR>
        <QUANTITY>8.00000</QUANTITY>
        <QTYCANCE>5.00000</QTYCANCE>
        <FREEONBOARD>1</FREEONBOARD>
        <REQDATE>5/16/2012</REQDATE>
        <RELEASEBYDATE>5/16/2012</RELEASEBYDATE>
        <PRMDATE>5/16/2012</PRMDATE>
        <PRMSHPDTE>5/16/2012</PRMSHPDTE>
        <ITEMDESC>Audio System</ITEMDESC>
        <UNITCOST>23.21000</UNITCOST>
        <VNDITDSC>Audio System</VNDITDSC>
        <UOFM>EACH</UOFM>
        <SHIPMTHD>MAIL</SHIPMTHD>
        <ORD>16384</ORD>
        <CUSTNMBR>
        </CUSTNMBR>
        <CMPNYNAM>Joe Test Company</CMPNYNAM>
        <CONTACT>
        </CONTACT>
        <ADDRESS1>1234 Mooks lane</ADDRESS1>
        <ADDRESS2>
        </ADDRESS2>
        <ADDRESS3>
        </ADDRESS3>
        <CITY>Comstock Park</CITY>
        <STATE>MI</STATE>
        <ZIPCODE>49321</ZIPCODE>
        <CCode>
        </CCode>
        <COUNTRY>United States</COUNTRY>
        <PHONE1>
        </PHONE1>
        <PHONE2>
        </PHONE2>
        <PHONE3>
        </PHONE3>
        <FAX>
        </FAX>
        <CURNCYID>Z-US$</CURNCYID>
        <LineNumber>1</LineNumber>
        <UpdateIfExists>1</UpdateIfExists>
      </taPoLine>
    </taPoLine_Items>
    <taPoHdr>
      <POTYPE>1</POTYPE>
      <PONUMBER>PO2382</PONUMBER>
      <VENDORID>JENSENSY0001</VENDORID>
      <VENDNAME>Jensen Systems</VENDNAME>
      <DOCDATE>5/16/2012</DOCDATE>
      <BUYERID>
      </BUYERID>
      <TRDISAMT>0.00000</TRDISAMT>
      <SUBTOTAL>69.6300</SUBTOTAL>
      <CUSTNMBR>
      </CUSTNMBR>
      <PRSTADCD>PRIMARY</PRSTADCD>
      <CMPNYNAM>Joe Test Company</CMPNYNAM>
      <CONTACT>
      </CONTACT>
      <ADDRESS1>1234 Mooks lane</ADDRESS1>
      <ADDRESS2>
      </ADDRESS2>
      <ADDRESS3>
      </ADDRESS3>
      <CITY>Comstock Park</CITY>
      <STATE>MI</STATE>
      <ZIPCODE>49321</ZIPCODE>
      <CCode>
      </CCode>
      <COUNTRY>United States</COUNTRY>
      <PHONE1>
      </PHONE1>
      <PHONE2>
      </PHONE2>
      <PHONE3>
      </PHONE3>
      <FAX>
      </FAX>
      <VADCDPAD>JOE</VADCDPAD>
      <PURCHCMPNYNAM>
      </PURCHCMPNYNAM>
      <PURCHCONTACT>some guy</PURCHCONTACT>
      <PURCHADDRESS1>678 Prince Court</PURCHADDRESS1>
      <PURCHADDRESS2>
      </PURCHADDRESS2>
      <PURCHADDRESS3>
      </PURCHADDRESS3>
      <PURCHCITY>Edmonton</PURCHCITY>
      <PURCHSTATE>AB</PURCHSTATE>
      <PURCHZIPCODE>T95 9K8</PURCHZIPCODE>
      <PURCHCCode>
      </PURCHCCode>
      <PURCHCOUNTRY>
      </PURCHCOUNTRY>
      <PRBTADCD>PRIMARY</PRBTADCD>
      <SHIPMTHD>MAIL</SHIPMTHD>
      <PYMTRMID>NET 30</PYMTRMID>
      <CURNCYID>Z-US$</CURNCYID>
      <USERID>joe</USERID>
      <POSTATUS>5</POSTATUS>
      <PRMDATE>5/16/2012</PRMDATE>
      <REQDATE>5/16/2012</REQDATE>
      <UpdateIfExists>1</UpdateIfExists>
    </taPoHdr>
  </POPTransactionType>
</eConnect>

Hi, I have a GP 2010 with 2 companies on it, and 2 additional companies on another SQL server.

I was planning on creating an empty company on the target server to create the entries in the Dynamics database, then overwrite the company file with the data from the second SQL server.

Everything appeared to look like it was working at first, but when I perform certain actions, like looking at some distributions, I get SQL errors. Is there anyway to rebuild the missing dynamics data from the company file?

Hi,

I'm looking for definitions of the various SourcDoc codes. Is there a master list along with definitions in a SQL table somewhere?

I am looking to create a trial balance file for 2012 but we h aven't closed 2011 yet. As a result, there is no period 0 opening balances for the balance sheet accounts, and the current balance represents period activity and not the true balance in the account.

Is there a way to query to get the correct balance even if the prior year isn't closed?

This is a simple example of the RadAjaxManager code that needs to go in a web page to 'Ajaxify' a control(s)

As a VB developer, I'm always struggling with the constants that are used in Menus for VS Tools. I imagine that if you're a Dex developer they're more accessible, but that's not me.

The grid below is copied from the help file, and we'll add it it as we find new values. Please don't hesitate to drop us a line if you have any additions.

Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3